【发布时间】:2017-09-29 17:45:09
【问题描述】:
对于身份验证,我使用的是 Auth0 AuthenticationApi。在帐户控制器中,我需要获取 user_metadata 但它丢失了。获取 user_metadata 的任何替代方法?
AuthenticationApiClient client = new AuthenticationApiClient(new Uri($"https://{_auth0Options.Domain}/"));
var authenticateResponse = await client.GetTokenAsync(new ResourceOwnerTokenRequest
{
ClientId = _auth0Options.ClientId,
ClientSecret = _auth0Options.ClientSecret,
Scope = "openid",
Realm = _auth0Options.Connection,
Username = vm.EmailAddress,
Password = vm.Password
});
var user = await client.GetUserInfoAsync(authenticateResponse.AccessToken);
if (user.UserMetadata != null)
{
// Giving error...any alternative to access the userMetaData ?
}
【问题讨论】:
标签: authentication model-view-controller oauth-2.0 auth0