Print Page | Close Window

Aspnet Authentication is not settin @ApplicationName

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3454
Printed Date: 13-May-2026 at 5:44am


Topic: Aspnet Authentication is not settin @ApplicationName
Posted By: pponzano
Subject: Aspnet Authentication is not settin @ApplicationName
Date Posted: 24-May-2012 at 6:49am
Hello,
I'm trying to validate using AspAuthenticatingLoginManager but when I call the ValidateUserCore

I got this executed

exec dbo.aspnet_Membership_GetPasswordWithFormat @ApplicationName=N'/',@UserName=N'test7',@UpdateLastLoginActivityDate=1,@CurrentTimeUtc='2012-05-24 13:43:00.780'

why it set the @ApplicationName to N'/'??

In my loginviewmodel I've

var loginCredential = new IFLoginCredential(username, password, "App123");


My connectionstring is

<remove name="LocalSqlServer" />

   <add name="LocalSqlServer" connectionString="data source=myconnection;initial catalog=myCatalog;user id=if;password=if;App=App123;Application Name=App123" providerName="System.Data.SqlClient" />


What am I doing wrong?
Thanks



Replies:
Posted By: sbelini
Date Posted: 24-May-2012 at 12:19pm
Hi Paolo.
I'm investivating and will follow up shortly.
Silvio.


Posted By: sbelini
Date Posted: 24-May-2012 at 12:49pm
Paolo,
 
You must make sure you properly set ApplicationName for the membership provider in <Membership>:
 
<system.web>
  <membership>
    <providers>
      <clear/>
      <add name="AspNetSqlMembershipProvider"
           type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
           connectionStringName="LocalSqlServer"
           enablePasswordRetrieval="false"
           enablePasswordReset="true"
           requiresQuestionAndAnswer="true"
           requiresUniqueEmail="false"
           passwordFormat="Hashed"
           maxInvalidPasswordAttempts="5"
           minRequiredPasswordLength="7"
           minRequiredNonalphanumericCharacters="1"
           passwordAttemptWindow="10"
           passwordStrengthRegularExpression=""
           applicationName="/App123" />
    </providers>
  </membership>
 
More details at http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx - http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx .
 
Regards,
   Silvio.
 


Posted By: pponzano
Date Posted: 24-May-2012 at 11:19pm
Hello again Silvio,
yesterday I tried but ointing to Version 4.0.0.0 .....I resolved setting the ApplicationName directly to the loginmanager class...btw I try your solution... thanks



Print Page | Close Window