MembershipCreateUserException - The username supplied is invalid

前端 未结 6 1391
情书的邮戳
情书的邮戳 2021-02-09 09:43

On this line i am getting an exception -

OAuthWebSecurity.CreateOrUpdateAccount(provider, providerUserId, model.UserName);

System.Web.Security

6条回答
  •  后悔当初
    2021-02-09 10:21

    According to MSDN (http://msdn.microsoft.com/en-us/library/82xx2e62.aspx) the Membership Class can't support usernames with a comma or null, spaces are OK (as are non ascii characters).

    The CreateUser method will return null if password is an empty string or null, username is an empty string or null or contains a comma (,), passwordQuestion is not null and is an empty string, or passwordAnswer is not null and contains an empty string.

提交回复
热议问题