[opensuse-buildservice] Direct HTTP to the frontend from webclient
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 ? -- ================================ Udit Sajjanhar -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2009-06-06 03:25:23 +0530, Udit Sajjanhar wrote:
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.
this sounds wrong from what i know about openid. the webbrowser needs to authenticate itself to the api.o.o. you dont send the authentication informations from the webclient with the request.
Is there already a way in which the headers can be set automatically and I only supply the controller name of the frontend ?
darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Sat, Jun 6, 2009 at 3:39 AM, Marcus Rueckert
On 2009-06-06 03:25:23 +0530, Udit Sajjanhar wrote:
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.
this sounds wrong from what i know about openid. the webbrowser needs to authenticate itself to the api.o.o. you dont send the authentication informations from the webclient with the request.
The exact scenario I am trying to implement is when an existing logged in user maps an openid url to his current login so that from the next time onwards he/she can login via the openid. Frontend will validate the openid from the provider. On successful validation, the openid url will stored in the user table. For storing the openid url in the user table, frontend needs the user and hence the headers. more details here: http://en.opensuse.org/Build_Service/OpenID_GSOC_Implementation#Features
Is there already a way in which the headers can be set automatically and I only supply the controller name of the frontend ?
darix
-- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
-- ================================ Udit Sajjanhar -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
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@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Mon, Jun 8, 2009 at 9:02 PM, Andreas Bauer
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@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
-- ================================ Udit Sajjanhar -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (3)
-
Andreas Bauer
-
Marcus Rueckert
-
Udit Sajjanhar