我正在使用 microsoft OidcClient
for oauth2.0 for google 帐户,我得到了
“用户信息端点缺少子声明”错误。”
谁能建议我是否遗漏了什么或做错了什么。
public async Task Authorize ()
{
InitializeComponent ();
var providerInformation = new ProviderInformation
{
IssuerName = "accounts.google.com",
AuthorizeEndpoint = "https://accounts.google.com/o/oauth2/auth",
TokenEndpoint = "https://oauth2.googleapis.com/token",
//UserInfoEndpoint = "https://openidconnect.googleapis.com/v1/userinfo",
UserInfoEndpoint = "https://www.googleapis.com/oauth2/v3/tokeninfo",
KeySet = new JsonWebKeySet()
};
var scope = "https://www.googleapis.com/auth/fitness.blood_glucose.read https://www.googleapis.com/auth/fitness.body.read https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.blood_pressure.read"; https://www.googleapis.com/auth/fitness.blood_glucose.read https://www.googleapis.com/auth/fitness.body.read https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/fitness.blood_pressure.read";
var options = new OidcClientOptions
{
Authority = "https://accounts.google.com/o/oauth2/auth",
ClientId = "xyz",
Scope = scope,
RedirectUri = "com.abc.xyzt:/oauthredirect",
Browser = browser,
ProviderInformation = providerInformation,
//ResponseMode = OidcClientOptions.AuthorizeResponseMode.Redirect,
TokenClientCredentialStyle = IdentityModel.Client.ClientCredentialStyle.AuthorizationHeader
};
_client = new OidcClient(options);
await _client.LoginAsync(new LoginRequest());
}
我收到了 6 种不同类型的索赔,但我没有得到JwtClaimTypes.Subject
"sub"
图书馆正在寻找的索赔。
谁能帮助或建议如何解决这个问题?