Search

just show me the code

Showing posts with label membership. Show all posts
Showing posts with label membership. Show all posts

Wednesday, May 27, 2009

forms authentication

...........

   38     <authentication mode="Forms">
   39       <forms loginUrl="~/Admin/Login.aspx" defaultUrl="~/Admin/Login.aspx"  protection="All" timeout="60"> 
   40         <credentials passwordFormat="Clear">
   41           <user name="ff" password="xxxxxx"/>
   42           <user name="someguy" password="xxxxxx"/>
   43         </credentials>
   44       </forms>
   45     </authentication>
   46     <authorization>
   47       <allow users="?/>
   48       <allow users="*">
   49     </authorization>

...........


  118   <location path="Public">
  119     <system.web>
  120       <authorization>
  121         <allow users="?"/>
  122       </authorization>
  123     </system.web>
  124   </location>
  125   <location path="Content">
  126     <system.web>
  127       <authorization>
  128         <allow users="?"/>
  129       </authorization>
  130     </system.web>
  131   </location>
  132   <location path="Admin">
  133     <system.web>
  134       <authorization>
  135         <allow users="ff"/>
  136         <deny users="*"/>
  137         <!--<allow users="?"/>-->
  138       </authorization>
  139     </system.web>
  140   </location>
  141   <location path="Admin/Login.aspx">
  142     <system.web>
  143       <authorization>
  144         <allow users="?"/>
  145       </authorization>
  146     </system.web>
  147   </location>


...........


   17
   18     protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
   19     {
   20         if (FormsAuthentication.Authenticate(this.Login1.UserName, this.Login1.Password))
   21             FormsAuthentication.RedirectFromLoginPage(this.Login1.UserName, true); 
   22     }




...........




Thanks to this link

Saturday, January 31, 2009

xml membership

credit to Atrem XmlProviders download their code from codeplex

   54     <membership defaultProvider="XmlMembershipProvider">
   55       <providers>
   56         <clear/>
   57         <add applicationName="SampleWebsite" 
   58              name="XmlMembershipProvider" 
   59              type="Artem.Web.Security.XmlMembershipProvider" 
   60              minRequiredPasswordLength="1"
minRequiredNonAlphanumericCharacters="0"
   61              requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
   62              passwordFormat="Hashed"/>
   63       </providers>
   64     </membership>
   77     <roleManager enabled="true" cacheRolesInCookie="true" 
defaultProvider
="XmlRoleProvider">
   78       <providers>
   79         <clear/>
   80         <add applicationName="SampleWebsite" name="XmlRoleProvider" 
type
="Artem.Web.Security.XmlRoleProvider"/>
   81       </providers>
   82     </roleManager> 
   83     <profile enabled="true" defaultProvider="XmlProfileProvider">
   84       <providers>
   85         <clear/>
   86         <add applicationName="SampleWebsite" name="XmlProfileProvider"
type="Artem.Web.Security.XmlProfileProvider"/>
   87       </providers>
   88       <properties>
   89         <group name="Person">
   90           <add name="FirstName" type="String"/>
   91           <add name="LastName" type="String"/>
   92           <add name="Years" type="Int32"/>
   93         </group>
   94         <add name="PageCursor" type="String"/>
   95         <add name="Counter" type="Int32" defaultValue="0"/>
   96       </properties>
   97     </profile>

Contributors