Re: Membership & Roles

Giganews Newsgroups
Subject: Re: Membership & Roles
Posted by:  Allen (ats…@ignore.hotmail.ignore.com)
Date: Wed, 18 Feb 2009

On Wed, 18 Feb 2009 14:21:09 +0000, Allen wrote:

> Good afternoon.  I have a web application created in VS.Net 2005.  I have
> configured the database and can create users and reset passwords etc.
> However, when a user enters username and password into the login control
> and hits enter the login page just refreshes and no redirection to
> Default.aspx takes place.  I have stepped through the code in the
> Login1_Authenticate event and the user is authenticated. For this I use the
> following code:
>
> Protected Sub Login1_Authenticate(ByVal sender As System.Object, ByVal e As
> System.Web.UI.WebControls.AuthenticateEventArgs) Handles
> Login1.Authenticate
>
> If Membership.ValidateUser(Me.Login1.UserName, Me.Login1.Password)                 
> Then
>            e.Authenticated = True
>        Else
>            e.Authenticated = False
>        End If
> End Sub
>
> In my web.config I have the following:
> <authentication mode="Forms">
>             <forms name="AuthCookie" path="/" loginUrl="login.aspx"
> timeout="10"></forms>
>         </authentication>
>         <membership defaultProvider="CustomizedProvider"
> userIsOnlineTimeWindow="20">
>             <providers>
>                 <clear />
>                 <add name="CustomizedProvider"
> type="System.Web.Security.SqlMembershipProvider"
> connectionStringName="RSDMConnStr" requiresUniqueEmail="false"
> requiresQuestionAndAnswer="true" passwordFormat="Clear"
> enablePasswordRetrieval="true" enablePasswordReset="true"
> minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="8"
> applicationName="RSDM" />
>             </providers>
>         </membership>
>         <authorization>
>             <deny users="*" />
>         </authorization>
>         
>         <roleManager enabled="true" defaultProvider="CustomizedProvider"
> cacheRolesInCookie="true" cookieName=".RSDMROLES" cookieTimeout="30"
> cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true"
> cookieProtection="All">
>             <providers>
>                 <clear />
>                 <add name="CustomizedProvider"
> type="System.Web.Security.SqlRoleProvider"
> connectionStringName="RSDMConnStr" applicationName="RSDM" />
>             </providers>
>         </roleManager>
>
> Is there something missing or wrong here?
>
> Second question concerns sub directories.  I want to ahve three or four
> pages that anybody can view and then I want to have a directory containing
> pages that users need to be logged in to see.  Do I need to have a seperate
> web.config or can I adapt the main web.config to do this?
>
> TIA

I have answered teh first part of my question. I had <deny users="*" />
instead of <deny users="?" />.  However, I still would like to know about
question 2 if anybody can help me :-)

--
ats@jbex

The cracks between the paving stones
Look like rivers of flowing veins.
Strange people who know me
Peeping from behind every window pane

The Who - The Real Me

Replies

None

In response to

Membership & Roles posted by Allen on Wed, 18 Feb 2009