Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

Membership authentication in VS 2013 not working as expected

$
0
0

When users login and I try to authenticate them, it is never successful and I'm unclear why this is happening.  I create users with

Membership.CreateUser(UserName.Text, Password.Text, Email.Text).  

No problems there and I can see the users being created in the database.  My web.config looks like this:

<authorization><deny users="?" /></authorization><authentication mode="Forms"><forms loginUrl="~/Account/Login" defaultUrl="~/" timeout="20" /></authentication><membership defaultProvider="DefaultMembershipProvider"><providers><add connectionStringName="ASPMembershipDB" enablePasswordRetrieval="false" enablePasswordReset="true" passwordFormat="Hashed" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /></providers></membership>

When users go to login, this code executes but users never authenticate.  User always returns Null.  

 Dim manager = New UserManager()
            Dim user As ApplicationUser = manager.Find(UserName.Text, Password.Text)
This code has worked in previous versions of VS but doesn't seem to work in 2013.  Any idea what I'm doing wrong here?



Viewing all articles
Browse latest Browse all 21115

Trending Articles



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