OK ... I was able to get my code to to retrieve nested groups, but what I want now is when a user clicks the login button (which points to your WindowsSignin.aspx) at that point I'm trying to get your WindowsSignin.aspx page to redirect to my page after yours finishes doing it's trick.
How can I get WindowsSignIn.aspx to redirect to another page of my choice instead of return to the HOME page?
Here is a snippet of code that I am using to sync my AS Groups and Roles:
On Error Resume Next
Using HostingEnvironment.Impersonate() <---This was my KEY mine kept using the annonymous user account... now my application pool is using a domain account
Dim ctx As PrincipalContext = New PrincipalContext(ContextType.Domain, "domain", "DC=domain,DC=com", ContextOptions.SimpleBind)
Dim u As UserPrincipal = New UserPrincipal(ctx)
u = UserPrincipal.FindByIdentity(ctx, UserInfo.Username)
Dim res As Boolean
Dim objRoles As New DotNetNuke.Security.Roles.RoleController
Dim Role As New DotNetNuke.Security.Roles.RoleInfo
For Each Role In objRoles.GetPortalRoles(PortalId)
If u.IsMemberOf(ctx, IdentityType.Name, Role.RoleName) Then
If DotNetNuke.Security.PortalSecurity.IsInRole(Role.RoleName) Then
Else
objRoles.AddUserRole(PortalId, UserId, Role.RoleID, Null.NullDate)
End If
End If
Next
End Using
This code requires .Net Framework 3.5 using the system.directoryservices.accountmanagement