概要
DotNetOpenAuthを使用してOP(OpenIDプロバイダー)を実装しました。OpenIdRelyingPartyWebForms
DrupalのOpenIDログインやDotNetOpenAuthのSamples
ソリューションのプロジェクトなどのRPの例(依存関係者)に対してテストしています。
問題は、私が知る限り、ブラウザーがOPに対してバウンスし、「成功した認証」要求(mode: id_res
、claimed_id: smth
など)をRPに送り返すときに、RPがサーバー側を実行しようとしないことです。 OPにリクエストし、実際にユーザーを認証したかどうかを尋ねます。OPから署名が返されていることopenid.sig
はわかりますが、OPとキーを交換しなかったため、RPがそれを検証する方法がわかりません。
したがって、質問は次のとおりです。ワークフローを安全にするために有効にできるOP側の設定はありますか?
技術的な詳細
Wiresharkを使用してRP側のHTTPトラフィックをスニッフィングしています。HTTPSがないので、すべてのメッセージを表示して読むことができます。以下に、正確に何が起こるかを示します。B =ブラウザー、OP = OpenIDプロバイダー、RP =証明書利用者。ドメイン名は*.example.comに置き換えられます。
(B –> RP)ユーザーは、証明書利用者のメンバー専用リソースにアクセスしようとします。彼は、ブラウザがRPに投稿するOPエンドポイントを入力します。
openid_identifier:http: //OP.example.com/OpenId/Provider.aspx?xrds
(RP –> OP –> RP) RPは、XRDSドキュメントを返すサーバー側の要求をOPに発行します。ここでは、秘密鍵交換に似たものは見当たりません。
<?xml version="1.0" encoding="UTF-8"?> <xrds:XRDS xmlns:xrds="xri://$xrds" xmlns:openid="http://openid.net/xmlns/1.0" xmlns="xri://$xrd*($v*2.0)"> <XRD> <Service priority="10"> <Type>http://specs.openid.net/auth/2.0/server</Type> <Type>http://openid.net/extensions/sreg/1.1</Type> <URI>http://OP.example.com/OpenId/Provider.aspx</URI> </Service> </XRD> </xrds:XRDS>
(RP –> B –> OP)証明書利用者302-ユーザーをOPの
/OpenId/Provider.aspx?[params]
URLにリダイレクトします。パラメーターは次のとおりです。openid.claimed_id: http://specs.openid.net/auth/2.0/identifier_select openid.identity: http://specs.openid.net/auth/2.0/identifier_select openid.assoc_handle: {634730422000625000}{jkQC1Q==}{32} openid.return_to: http://RP.example.com/login.aspx?ReturnUrl=%2FMembersOnly%2FDefault.aspx&dnoa.receiver=ctl00_Main_OpenIdLogin1&dnoa.UsePersistentCookie=Session&dnoa.userSuppliedIdentifier=http%3A%2F%2FOP.example.com%2FOpenId%2FProvider.aspx%3Fxrds openid.realm: http://RP.example.com/ openid.mode: checkid_setup openid.ns: http://specs.openid.net/auth/2.0 openid.ns.sreg: http://openid.net/extensions/sreg/1.1 openid.sreg.policy_url: http://RP.example.com/PrivacyPolicy.aspx openid.sreg.required: email,gender,postcode,timezone
(OP –> B –> RP)プロバイダーはユーザーを認証し、302-次のURLパラメーターを使用してユーザーをRPにリダイレクトします。
ReturnUrl: /MembersOnly/Default.aspx dnoa.receiver: ctl00_Main_OpenIdLogin1 dnoa.UsePersistentCookie: Session dnoa.userSuppliedIdentifier: http://OP.example.com/OpenId/Provider.aspx?xrds openid.claimed_id: http://OP.example.com/OpenId/User.aspx/2925 openid.identity: http://OP.example.com/OpenId/User.aspx/2925 openid.sig: pWJ0ugjQATKGgRSW740bml9LDsSxFiJ+a9OLO6NlsvY= openid.signed: claimed_id,identity,assoc_handle,op_endpoint,return_to,response_nonce,ns.sreg,sreg.nickname,sreg.email openid.assoc_handle: {634730422000625000}{jkQC1Q==}{32} openid.op_endpoint: http://OP.example.com/OpenId/Provider.aspx openid.return_to: http://RP.example.com/login.aspx?ReturnUrl=%2FMembersOnly%2FDefault.aspx&dnoa.receiver=ctl00_Main_OpenIdLogin1&dnoa.UsePersistentCookie=Session&dnoa.userSuppliedIdentifier=http%3A%2F%2FOP.example.com%2FOpenId%2FProvider.aspx%3Fxrds openid.response_nonce: 2012-05-19T16:40:11ZSfsL4BK1 openid.mode: id_res openid.ns: http://specs.openid.net/auth/2.0 openid.ns.sreg: http://openid.net/extensions/sreg/1.1 openid.sreg.nickname: user@OP.example.com openid.sreg.email: user@OP.example.com
(RP –> OP) RPは、OPに対してサーバー側のHTTP要求を実行します。データは転送されず、以前に取得したユーザーIDURLへのGETリクエストのみが転送されます。ちなみに、なぜこのリクエストをするのですか?
GET /OpenId/User.aspx/2925 HTTP/1.1
(OP –> RP) OPは別のXRDSドキュメントで応答します。
<xrds:XRDS xmlns:xrds="xri://$xrds" xmlns:openid="http://openid.net/xmlns/1.0" xmlns="xri://$xrd*($v*2.0)"> <XRD> <Service priority="10"> <Type>http://specs.openid.net/auth/2.0/signon</Type> <Type>http://openid.net/extensions/sreg/1.1</Type> <URI>http://OP.example.com/OpenId/Provider.aspx</URI> </Service> <Service priority="20"> <Type>http://openid.net/signon/1.0</Type> <Type>http://openid.net/extensions/sreg/1.1</Type> <URI>http://OP.example.com/OpenId/Provider.aspx</URI> </Service> </XRD> </xrds:XRDS>
(RP –> B)それだけです。ユーザーは承認され、RPはメンバー専用のリソースを表示します。