Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...DNNRolesProvider or AspNetRolespProviderDNNRolesProvider or AspNetRolespProvider
Previous
 
Next
New Post
9/14/2006 5:06 AM
 

Hi people
I'm using DNN 4.3.4 and I have some problem relatively at how to configure DNNRolesProvider for caching roles in cookie. My configuration in web.config is:

<authentication mode="Forms">
   <
forms name=".MYUSER"
      
protection="All"
      
timeout="20"
      
path="/"
      
domain="mydomain.local"
      
requireSSL="false"
      
slidingExpiration="true"
      
enableCrossAppRedirects="true"/>
</authentication>

<membership defaultProvider="AspNetMembershipProvider" userIsOnlineTimeWindow="20">
   <
providers
>
      <
remove name="AspNetSqlMembershipProvider"
/>
      <
add connectionStringName="SiteSqlServer"
         enablePasswordRetrieval="false"
         enablePasswordReset="true"
         requiresQuestionAndAnswer="false"
         applicationName="PortalName"
         requiresUniqueEmail="false"
         passwordFormat="Hashed"
         minRequiredPasswordLength="7"
         minRequiredNonalphanumericCharacters="0"
         passwordAttemptWindow="10"
         name="AspNetMembershipProvider"
         type="System.Web.Security.SqlMembershipProvider"
/>
   </
providers
>
</
membership
>

<roleManager
   
defaultProvider="AspNetRolesProvider"
   enabled="true"
   cacheRolesInCookie="true"
   cookieName=".MYROLES"
   cookiePath="/"
   cookieRequireSSL="false"
   cookieProtection="All"
   cookieTimeout="20"
   cookieSlidingExpiration="true"
   createPersistentCookie="false"
   maxCachedResults="25"
   domain="mydomain.local"
>
   <
providers
>
      <
remove name="AspNetSqlRoleProvider"
/>
      <
remove name="AspNetWindowsTokenRoleProvider"
/>
      <
add connectionStringName="SiteSqlServer"
         applicationName="PortalName"
         name="AspNetRolesProvider"
         type="System.Web.Security.SqlRoleProvider"
         description="Provider for Roles"
/>
   </
providers
>
</
roleManager>

I've typed some code in global.asax and ASP.NET Roles work well but the cookie (".MYROLES") is never cached (while the cookie ".MYUSER" is always cached). The same configuration work well on DNN 4.0.2.

Where is the problem?????

Please Help me... Thanks

 

 

 
New Post
9/25/2006 6:46 AM
 

I wrote same code in global.asax, now the cookie is present but the role managet feature don't work.

Here the code:

Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As System.EventArgs)
   retrieveRolesTick()
End Sub

Private Sub retriveRolesTick()
   If (Me.Request.IsAuthenticated)
Then
      
Try
         D
im r As New RolePrincipal(Me.Context.User.Identity, Me.Request.Cookies(System.Web.Security.Roles.CookieName).Value)
      Catch ex As Exception
      End
Try
   
End
If
End Sub

Protected Sub Application_EndRequest(ByVal sender As Object, ByVal e As System.EventArgs)
   putASPNETTICK()
End Sub

Private Sub putASPNETTick()
   If (Me.Request.IsAuthenticated)
Then
      
Try
         
System.Web.Security.Roles.DeleteCookie()
         Dim rP As New System.Web.Security.RolePrincipal(Me.Context.User.Identity)
         Dim eTicket As String = rP.ToEncryptedTicket()
         Dim cookie As System.Web.HttpCookie = New System.Web.HttpCookie(System.Web.Security.Roles.CookieName, eTicket)
         cookie.Path = System.Web.Security.Roles.CookiePath
         cookie.Domain = System.Web.Security.Roles.Domain
         cookie.Expires = System.DateTime.Now().AddMinutes(System.Web.Security.Roles.CookieTimeout())
         Response.Cookies.Add(cookie)
      Catch e As InvalidCastException
      End
Try
   End
If
End Sub

Some idea?????

Please Help me!!!!!

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...DNNRolesProvider or AspNetRolespProviderDNNRolesProvider or AspNetRolespProvider


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out