認証の詳細(ユーザー名/パスワード)をIdentityServer4に送信し、トークン・バック(認可タイプ=リソース所有者のパスワード)を正常に受信するAngular 4サイトを構築します。IdentityServer4クッキーの認証
今、私のAngular 4サイトから別の(別の)ASP Core MVCサイトにリダイレクトしたいと思います。 どういうわけか、トークンを認可として渡すためのリダイレクトで「ヘッダー」を設定する方法が見つかりません:ベアラxxx。
私は角度サイトでクッキーを設定してからちょうどwindow.location.href = 'www.example.com/another_site
MVCサイトでは、私はStartup.csに設定します。
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
...
...
app.UseCookieAuthentication(new CookieAuthenticationOptions()
{
AuthenticationScheme = "Cookies_Authentication",
AutomaticAuthenticate = true,
AutomaticChallenge = true
});
app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
{
Authority = "http://my_identityserver4_address:49950",
RequireHttpsMetadata = false,
AuthenticationScheme = "Cookies_Authentication",
ApiName = "Protected_Api.get",
AutomaticAuthenticate = true,
AutomaticChallenge = true
});
}
が、私はまだMVCサイトから401不正な応答を受信しています。私は間違っているの?
特別なCookie名を探しているIdentityServerがありますか?私はあなただけのIDサーバからトークンを受信する方法MVCアプリを参照して、角度のアプリからリダイレクトするときちょうど同じ事をするあなたの答えhereを見つけるかもしれないと思う
cookieService.setItem('access_token', 'eyJhbGciOiJSUzI1NiIsImtpZCI6ImFlOWEyMzNhZDczOTUwNWI4YjJkZGE0NTNiMDE........)
あなたの答えはもっとも近いものでした - 私は[OAuthとOpenID Connect](https://identityserver4.readthedocs.io/en/release/quickstarts/3_interactive_login.html)についてもっと知る必要がありますが、方向は使用することですOpneIDベアラヘッダーではなくクッキー認証のために接続します。 – Jasper