Mailinglist Archive: opensuse-buildservice (213 mails)

< Previous Next >
Re: [opensuse-buildservice] Direct HTTP to the frontend from webclient
  • From: Udit Sajjanhar <udit@xxxxxxxxxxx>
  • Date: Wed, 10 Jun 2009 10:09:20 +0530
  • Message-id: <d0c6f0e90906092139k2bcadc30u980a24e10763a98e@xxxxxxxxxxxxxx>
On Mon, Jun 8, 2009 at 9:02 PM, Andreas Bauer <abauer@xxxxxxx> wrote:

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.
302 response will not raise an exception.

For my usecase, I want the frontend to redirect to the appropriate
openid provider.
However submitting a request to frontend from webclient via
"direct_http" returns a 302 response, saying "you are being redirected
to the <openid-provider-url>"

Is there any way I can make the frontend redirect to openid provider?


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




--
================================
Udit Sajjanhar
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >