NullReferenceException bug in OpenID fixed

This commit is contained in:
Tomas Herceg
2014-04-22 19:32:37 +02:00
parent 3a02489eb1
commit a341dc7cc1

View File

@@ -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));