Mailinglist Archive: opensuse-buildservice (213 mails)

< Previous Next >
Re: [opensuse-buildservice] Direct HTTP to the frontend from webclient
  • From: Andreas Bauer <abauer@xxxxxxx>
  • Date: Mon, 08 Jun 2009 17:32:37 +0200
  • Message-id: <4A2D2F15.7020700@xxxxxxx>
Udit Sajjanhar schrieb:
I am implementing openid for buildservice on the frontend.

Webclient is required to send an direct html request to the frontend
for the verification of openid.

The problem is that I need to send authentication information in the headers.

Is there already a way in which the headers can be set automatically
and I only supply the controller name of the frontend ?

The solution to this is neither straightforward nor documented well,
sorry for that.

You need to do something like this:

-- code --
transport = ActiveXML::Config.transport_for(:project)
transport.set_additional_header("Header-Name", "header value")

uri = URI("#{FRONTEND_PROTOCOL}:///path/to/frontend/action")
transport.direct_http(uri, :method => :post, :data => "")

transport.delete_additional_header("Header-Name")
-- /code --

Responses other than 2xx raise exceptions inherited from
ActiveXML::Transport::Error.

In case you're interested, ActiveXML::Transport is implemented in
trunk/buildservice/src/common/lib/activexml/transport.rb.

Andreas


--
================================
Udit Sajjanhar


--
Andreas Bauer
SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG N├╝rnberg
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References