diff --git a/Owin.Security.Providers/OpenID/OpenIDAuthenticationHandler.cs b/Owin.Security.Providers/OpenID/OpenIDAuthenticationHandler.cs index 7b9e26b..342ed5e 100644 --- a/Owin.Security.Providers/OpenID/OpenIDAuthenticationHandler.cs +++ b/Owin.Security.Providers/OpenID/OpenIDAuthenticationHandler.cs @@ -247,10 +247,14 @@ namespace Owin.Security.Providers.OpenID { nameValue = lastValue; } - else + else if (!string.IsNullOrEmpty(emailValue) && emailValue.Contains("@")) { nameValue = emailValue.Substring(0, emailValue.IndexOf('@')); } + else + { + nameValue = claimedID; + } } identity.AddClaim(new Claim(ClaimTypes.Name, nameValue, "http://www.w3.org/2001/XMLSchema#string", Options.AuthenticationType));