私のアプリケーションは、このようにOpenIDのを使用して認証:asp.netコアのopenidアクセストークンからクレームを取得するにはどうすればよいですか?
services.AddAuthentication(o =>
{
o.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
o.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
o.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
})
.AddCookie()
.AddOpenIdConnect(o =>
{
o.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
o.Scope.Add("openid");
o.Scope.Add("permissions");
o.Authority = "https://localhost:44305";
o.ClientId = "MyTestClient";
o.ClientSecret = "MyTestClientSecret";
o.ResponseType = OpenIdConnectResponseType.IdTokenToken;
});
私は認証後にユーザーオブジェクトをチェックすると、それが唯一のIDトークンからのクレームではなく、アクセストークンを持っています。アクセストークンからクレームを取得するにはどうすればよいですか?
私はまったく同じ問題を抱えていますが、解決策を見つけましたか?ありがとう –
@MatthewChristianson nope :( –
私は私のために働いた答えを追加しました。私はOpenIdからaccess_tokenを得ることはできませんでした –