2016-08-11 20 views
3

OpenId connectを使用するようにWSO2 Identity Serverを設定しようとしています。私は現在、Here: Setup WSO2と表示されている以下の設定を適用しています。WSO2 Identity Server OpenId Connect Owin

私は住人のIDプロバイダを使用しており、私は自分のアプリ "CoolApp"のサービスプロバイダをセットアップしているということです。

"OAuth/OpenID Connect設定"を設定し、コールバックURLを設定しました。

javascriptでこれを使用する方法の簡単な例はありますか?

私はidentityserver3で遊んだり、idserver3と組み合わせてうまく動作するクライアントoidc-client.jsを持っています。しかし、私はそれがWSO2のIDサーバーで動作するように思えます。私は実際に何を望むか


私は間違った方法で問題についてつもりだったが、彼らはherehereをしようとしたようowinミドルウェアを使用して私のウェブサイトを保護することでした。

ので、今私は、次のしている:

を私はSecurityTokenValidatedとAuthenticationFailedにブレークポイントを置きます。ページに移動し、WSO2 IDサーバーに期待どおりにリダイレクトされます。私がログインしてページに戻ると、私のブレークポイントは両方ともヒットせず、ログインしていません。

私はWSO2 Identity Server 5.1.0を使用しています。

@farasath、私たちはすべて同じ問題に遭遇しているように見えます。

さらなる調査中に、OIDCミドルウェアがサポートしていないため、response_type = "code"のコードフローを使用すると、OIDCミドルウェアがサポートされないことがわかりました(hereおよびhere参照)。

ASP.netコアがこれをサポートしているという@pinpointの提案が見つかりました。しかし、これは本当にオプションではありません。 WSO2 Identity Serverの5.0.0 OpenIDの接続 "id_token" 応答タイプが実装されていないと

@Hosはhereに答え。

私は彼のポストで言及したエラー応答を得ていませんが、私の結果はこれらのバージョンを使用して同じままで、ブレークポイントは決して打撃を受けません。だから私はこれが5.1.0または5.2.0-Betaで実際に動作するのだろうと思っていますか、これはまだWIPです。


@farasath、ご返信いただきありがとうございますここにログがある

[2016-08-16 08:11:39,998] DEBUG {org.wso2.carbon.identity.oauth2.OAuth2Service} - Validate Client information request for client_id : fgx4M5e27NJqgRIs8nu5aL7Jw3oa and callback_uri http://localhost:57815/ 
[2016-08-16 08:11:40,074] DEBUG {org.wso2.carbon.identity.oauth2.OAuth2Service} - Registered App found for the given Client Id : fgx4M5e27NJqgRIs8nu5aL7Jw3oa ,App Name : CoolApp, Callback URL : http://localhost:57815/ 
[2016-08-16 08:11:50,948] DEBUG {org.wso2.carbon.identity.oauth2.OAuth2Service} - Authorization Request received for user : [email protected], Client ID : fgx4M5e27NJqgRIs8nu5aL7Jw3oa, Authorization Response Type : id_token token, Requested callback URI : http://localhost:57815/, Requested Scope : openid 
[2016-08-16 08:11:50,967] INFO {org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration} - The default OAuth token issuer will be used. No custom token generator is set. 
[2016-08-16 08:11:50,985] INFO {org.wso2.carbon.identity.oauth2.dao.TokenMgtDAO} - Thread pool size for session persistent consumer : 100 
[2016-08-16 08:11:50,991] DEBUG {org.wso2.carbon.identity.oauth2.dao.TokenPersistenceTask} - Access Token context persist consumer is started 
... This one repeats about 100 times ... 
[2016-08-16 08:11:51,031] DEBUG {org.wso2.carbon.identity.oauth2.authz.AuthorizationHandlerManager} - Successfully created AppInfoCache under OAuthCacheManager 
[2016-08-16 08:11:51,206] DEBUG {org.wso2.carbon.identity.oauth2.util.OAuth2Util} - Added OAuthAuthzReqMessageContext to threadlocal 
[2016-08-16 08:11:52,180] DEBUG {org.wso2.carbon.identity.oauth2.authz.handlers.TokenResponseTypeHandler} - No active access token found in cache for Client ID : fgx4M5e27NJqgRIs8nu5aL7Jw3oa, User ID : [email protected] and Scope : openid 
[2016-08-16 08:11:52,199] DEBUG {org.wso2.carbon.identity.oauth2.authz.handlers.TokenResponseTypeHandler} - No access token found in database for Client ID : fgx4M5e27NJqgRIs8nu5aL7Jw3oa, User ID : [email protected] and Scope : openid. Therefore issuing new access token 
[2016-08-16 08:11:52,208] DEBUG {org.wso2.carbon.identity.oauth2.dao.TokenPersistenceTask} - Access Token Data persisting Task is started to run 
[2016-08-16 08:11:52,208] DEBUG {org.wso2.carbon.identity.oauth2.authz.handlers.TokenResponseTypeHandler} - Persisted Access Token for Client ID : fgx4M5e27NJqgRIs8nu5aL7Jw3oa, Authorized User : [email protected], Timestamp : 2016-08-16 08:11:52.207, Validity period (s) : 3600, Scope : openid, Callback URL : http://localhost:57815/, Token State : ACTIVE and User Type : APPLICATION_USER 
[2016-08-16 08:11:52,233] DEBUG {org.wso2.carbon.identity.oauth2.authz.handlers.TokenResponseTypeHandler} - Access Token was added to OAuthCache for cache key : fgx4M5e27NJqgRIs8nu5aL7Jw3oa:[email protected]:openid 
[2016-08-16 08:11:52,298] DEBUG {org.wso2.carbon.identity.oauth2.util.OAuth2Util} - Cleared OAuthAuthzReqMessageContext 

私はこのログなった私はそれを実行したセカンドタイム:


[2016-08-16 08:30:17,216] DEBUG {org.wso2.carbon.identity.oauth2.OAuth2Service} - Validate Client information request for client_id : fgx4M5e27NJqgRIs8nu5aL7Jw3oa and callback_uri http://localhost:57815/ 
[2016-08-16 08:30:17,222] DEBUG {org.wso2.carbon.identity.oauth2.OAuth2Service} - Registered App found for the given Client Id : fgx4M5e27NJqgRIs8nu5aL7Jw3oa ,App Name : CoolApp, Callback URL : http://localhost:57815/ 
[2016-08-16 08:30:23,178] DEBUG {org.wso2.carbon.identity.oauth2.OAuth2Service} - Authorization Request received for user : [email protected], Client ID : fgx4M5e27NJqgRIs8nu5aL7Jw3oa, Authorization Response Type : id_token token, Requested callback URI : http://localhost:57815/, Requested Scope : openid 
[2016-08-16 08:30:23,189] DEBUG {org.wso2.carbon.identity.oauth2.util.OAuth2Util} - Added OAuthAuthzReqMessageContext to threadlocal 
[2016-08-16 08:30:23,195] DEBUG {org.wso2.carbon.identity.oauth2.authz.handlers.TokenResponseTypeHandler} - Retrieved active Access Token for Client Id : fgx4M5e27NJqgRIs8nu5aL7Jw3oa, User ID :[email protected] and Scope : openid from cache 
[2016-08-16 08:30:23,203] DEBUG {org.wso2.carbon.identity.oauth2.authz.handlers.TokenResponseTypeHandler} - Access Token is valid for another 3264638ms 
[2016-08-16 08:30:23,218] DEBUG {org.wso2.carbon.identity.oauth2.util.OAuth2Util} - Cleared OAuthAuthzReqMessageContext 
は、今私は変更を私のリダイレクトuri: RedirectUri = " http://localhost:57815/Account/ExternalLoginCallback/"、

この関数のlogInfoは常にnullです。 var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();

グーグルで回って、誰かが同様の問題を抱えていたthis postが見つかりました。コールバックを見てフィドラーを使用し


クッキーは今Imは、以下のような状況に残されそうScreenshot


を設定されているように見えます:SecurityTokenValidatedで

  • ブレークポイントは
  • を打つことはありません
  • AuthenticationFailedのブレークポイントは決してヒットしません。
  • var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();私のコールバックで常にnullです
+0

@farasathが(これは審査で私に指摘されました)。だから残念ながらあなたのコメントも失われてしまった。しかし、あなたが要求したように、私はロギングをオンにして走りました。そして、私はまた、フィドラーでさらに調査しました。 –

答えて

0

AFAIK私たちはあなたが直接使用することができますJavascriptサンプルがありません。しかし、それはまったく問題ではありません。私はグーグルでグーグルに出会いました。 client_idとコールバックURLを置き換えるだけです。 OAuth/OpenID接続仕様に従うので、OAuth JavascriptクライアントライブラリはWSO2 Identity Serverと連携する必要があります。

Webアプリケーションのサンプル[2]があり、WSO2 Identity Serverの認証コードフローを示すためにブログの投稿[3]を作成しました。

[1] https://github.com/zalando/oauth2-client-js

を[2] https://docs.wso2.com/display/IS510/OAuth+2.0+with+WSO2+Playground

を[3]このためhttp://blog.farazath.com/2016/05/trying-out-oauth2-authorization-code.html

+0

私は間違って始めたことを知ったので、私は質問を言い換えようとしました。 –

1

理由OWINのミドルウェアである1 [OAuth 2.0のフォームポストの応答モードでのOAuthの応答を期待しています]これはオプション仕様で、Identity Server 5.2.0(パッチあり)のみがこれをサポートしています。

[1]私が行ったような答えを使用しての代わりに私の質問を編集する必要がありましたhttp://openid.net/specs/oauth-v2-form-post-response-mode-1_0.html

関連する問題