Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 3rd, 2007, 10:58 AM
Authorized User
 
Join Date: May 2007
Location: moeskroen, henegauwen, Belgium.
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to swifty_programmer
Default failed to login with membershipprovider

Hi all,
I'm making a quite simpel website for the support in my company.
Not everyone should be able to do all the actions (ex: add customer...) so I want a role based security on my webpage.
I choosed to store credentials and roles in a SQL 2005 Enterprise Ed. DB through the command "asp_reg..."
DB was created successfully(name: membershipDB).
I've added rolemanager (with provider) and membership provider in de web.config.
I'm able to add users, roles... via Web Site Administration Tool.
But when I want to login with one of those users, I can't...
This is REALY frustrating!
I've tried the Membership.ValidateUser(username, password) and it returns false?!?... I've checked every character in my code three times and I do not understand. All help are welcome!

Grtz
  #2 (permalink)  
Old May 3rd, 2007, 11:38 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

If you're looking in the aspnet_Applications table, how many records do you see? Maybe you created users in one app, and try to login for another.

Since ASP.NET creates apps for you automatically, there may be a mismatch...

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
  #3 (permalink)  
Old May 4th, 2007, 02:01 AM
Authorized User
 
Join Date: May 2007
Location: moeskroen, henegauwen, Belgium.
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to swifty_programmer
Default

I'v checked the SQL db, I have only 1 row with the correct applicationName in aspnet_Applications.
All my user are correctly linked to the applicationId.
The DB looks allright, and the membership provider and connectionstrings too. It's only a problem when I try to acces it via my code...
Here's a copy of the web.config:

<?xml version="1.0"?>

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <appSettings>
    <add key="IntelliServerUrl" value="tcp://localhost:40000/IntelliServer_v4"/>
  </appSettings>
  <connectionStrings>
    <add name="membershipDB"
         connectionString="Data Source=GEO-DC01;Initial Catalog=membershipDB;Persist Security Info=True;User ID=***;Password=***"
        providerName="System.Data.SqlClient" />
    <add name="IntelliServer_v4"
        connectionString="Data Source=GEO-DC01;Initial Catalog=IntelliServer_v4;Persist Security Info=True;User ID=***;Password=***"
        providerName="System.Data.SqlClient" />
    <add name="IntelliTracer_v1"
        connectionString="Data Source=GEO-DC01;Initial Catalog=IntelliTracer_v1;Persist Security Info=True;User ID=***;Password=***"
        providerName="System.Data.SqlClient" />
    <add name="IntelliTracer_v3"
    connectionString="Data Source=GEO-DC01;Initial Catalog=IntelliTracer_v3;Persist Security Info=True;User ID=sa;Password=mile%9000stone"
    providerName="System.Data.SqlClient" />
  </connectionStrings>

    <system.web>

        <compilation debug="true" />

      <authentication mode="Forms">
        <forms name="adminAuth"
               path="/"
               loginUrl="login.aspx"
               protection="All"
               timeout="30"
               requireSSL="false"
               slidingExpiration="true">
        </forms>
      </authentication>

      <roleManager enabled="true" defaultProvider="SqlRoleManager">
        <providers>
          <add name="SqlRoleManager"
               type="System.Web.Security.SqlRoleProvider"
               connectionStringName="membershipDB"/>
        </providers>
      </roleManager>

      <membership defaultProvider="SqlMembershipProvider" userIsOnlineTimeWindow="15">
        <providers>
          <clear />
          <add
            name="SqlMembershipProvider"
            type="System.Web.Security.SqlMembershipProvider"
            connectionStringName="membershipDB"
            enablePasswordRetrieval="false"
            enablePasswordReset="false"
            requiresQuestionAndAnswer="false"
            requiresUniqueEmail="false"
            applicationName="/GeoDynamics.IntelliTracer.Admin.Web"
            passwordFormat="Clear"
            />
        </providers>
      </membership>
      <authorization>
        <allow users="*" />
      </authorization>

    </system.web>
</configuration>
  #4 (permalink)  
Old May 4th, 2007, 02:53 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

The only thing I can see is that you're missing an applicationName for the RoleProvider. Otherwise, I can't see why this doesn't work...

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
failed to login with membershipprovider swifty_programmer ASP.NET 2.0 Basics 1 May 3rd, 2007 11:40 AM
login failed for user nt authority\anonymous login rj1406 Classic ASP Databases 1 October 24th, 2004 09:15 AM



All times are GMT -4. The time now is 04:37 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.