私は現在、https://github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Serverとasp.netコアIDをバッキングストアとして使用してopenid接続サーバーを構築しています。私は、プロトコル、フロー、セキュリティホールについて認識しています。openidconnect.server、サードパーティプロバイダとリダイレクト
次のように現在の設定は次のとおりです。 [server]
- 認証サーバ&リソースサーバ [front-end]
- angularJSアプリケーション [third-party-provider]
- グーグル [external-app]
- [サーバー]からトークンを使用する2番目のアプリケーション
[front-end]
と[external-app]
は、[server]
のクライアントとして登録されています。したがって、彼らはトークンを取り出すことが許されている。ログインページは[front-end]
のビルドです。
[server]
からIDを取得するために
[external-app]
でログインしたいと思います想像してログインページなどが
(代わりにAccountControllerからAuthViewを返す)[front-end]
アプリケーションによって示されていることに注意してください。ログインページは[front-end]
です。その後の流れは次のようになります:私は欠けている(と、それは実装上の問題、と思った傷や何でもあるかもしれない)
1. [external-app] -> http://[server]/account/authorize?client_id=[external-
app-clientid]&response_type=token&redirect_uri=http://[external-app-
redirecturi]
2. [front-end] -> matches route -> show login page
3. [front-end] -> user clicks on login with google
4. [front-end] -> redirect to 'http://[server]/account/authorize/connect?
provider=Google&redirect_uri=http://[front-
end]/account/thirdparty/authorized&response_type=code&client_id=[front-
end-clientid]
5. [server] -> no identity found, save request in session and let the user
login at the [third-party] (using ChallengeResult and also passing in the
request id which was stored in session)
6. [third-party-provider] user logs in
7. [front-end] -> http://[front-end]/account/thirdparty/authorized recieved
the code
8. [front-end] -> exchange authcode for token with [server] using
http://[server]/account/token&grant_type=authorization_code&code=
[code]&redirect_uri=http://[front-
end]/account/thirdparty/authorized&client=[front-end-clientid]
9. [server] -> generate claims and return token
10. [front-end] -> token recieved
事は、私が戻って[external-app
にリダイレクトする必要があるということです]与えられたトークンで。私は[front-end]
でそれをする必要がありますか?それは感じて、私はちょっと混乱していると確信している/間違って一致するもの。誰か助けてくれますか?
ありがとうございます!
PSはい、わかっていますが、httpsにする必要があります。
あなた自身のopenid接続サーバーを構築してもよろしいですか?そういう理由があるかもしれませんが、達成しようとしていることを正確に実行しているソリューションが既に実装されていると言えます。 Identity Serverをご覧ください:https://github.com/IdentityServer/IdentityServer4 – henningst
私は現在https://github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Serverを使用していますので、やっていませんそれは私自身ですべてです...しかし、私はリダイレクトの流れにいくつかの助けを必要とします:)私はこのライブラリを使用して私は事実を反映するために私の質問を更新する! –