2
我的應用程序驗證使用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 noope :( –
我已經添加了一個適用於我的答案。我永遠無法從OpenId獲取access_token –