Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Issue: "i" "I" character problem at SimpleMembershipProvider.cs [714]

$
0
0
in Turkish,
we have "i" and "ı" characters. (...h,ı,i,j,k,l,m,...)
"i" is lower, "İ" is upper of "i",
"ı" is lower, "I" is upper of "ı".

When we use membership at MVC4, if "UserName" is includes "i" character, we see this error "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator.".

I looked code at GetUserId(...) at http://aspnetwebstack.codeplex.com/SourceControl/changeset/view/ac69f85f94aa#src/WebMatrix.WebData/SimpleMembershipProvider.cs and I saw "userName.ToUpperInvariant()".

CreateUserAndAccount(...) is create a record at table, if UserName includes "i", it records "i" directly "i", then call GetUserId(...) but GetUserId tries to find "I" character because of "userName.ToUpperInvariant()" and it doesn't find record.

we are talking this at http://forums.asp.net/p/1862233/5240665.aspx/1?Re+How+can+i+use+email+address+for+username+in+MVC4+Membership ,may be this forum page is more help to understand.


internal static int GetUserId(IDatabase db, string userTableName, string userNameColumn, string userIdColumn, string userName)
{
var result = db.QueryValue(@"SELECT " + userIdColumn + " FROM " + userTableName + " WHERE (UPPER(" + userNameColumn + ") = @0)", userName.ToUpperInvariant());
if (result != null)
{
return (int)result;
}
return -1;
}




Comments: Resolved with https://aspnetwebstack.codeplex.com/SourceControl/changeset/d8d15ae5e4f49bcc4feea75193a351e4b29cce32

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>