Unable to convert user ID (google-oauth2|***)to int using InvariantCulture
Hello,
I am using auth0 as external identity provider and authenticate frontend members. After login, I put the logic in returnUri page like this.
var result = await HttpContext.AuthenticateAsync(Auth0Constants.AuthenticationScheme);
if (!result.Succeeded) throw new Exception("Missing external cookie");
var email = result.Principal.FindFirstValue(ClaimTypes.Email)
?? result.Principal.FindFirstValue("email")
?? throw new Exception("Missing email claim");
var user = await _memberManager.FindByEmailAsync(email);
if (user == null)
{
_memberService.CreateMemberWithIdentity(email, email, email, Constants.Security.DefaultMemberTypeAlias);
user = await _memberManager.FindByNameAsync(email);
await _memberManager.AddToRolesAsync(user, new[] { "User" });
}
await HttpContext.SignOutAsync(Auth0Constants.AuthenticationScheme);
await _memberSignInManager.SignInAsync(user, false);
I thought the auth0 cookie has been clean up and umbraco user has been logined.
But got the error of
"Unable to convert user ID (google-oauth2|*)to int using InvariantCulture" when calling memberManager.GetCurrentMemberAsync. It seems the memberManager still hold the external login schema?
Unable to convert user ID (google-oauth2|***)to int using InvariantCulture
Hello,
I am using auth0 as external identity provider and authenticate frontend members. After login, I put the logic in returnUri page like this.
I thought the auth0 cookie has been clean up and umbraco user has been logined. But got the error of "Unable to convert user ID (google-oauth2|*)to int using InvariantCulture" when calling memberManager.GetCurrentMemberAsync. It seems the memberManager still hold the external login schema?
Any ideas will be appreciated.
is working on a reply...