0

I would like to redirect user depending on their description AD attribute.

I'm building a ASPX page (with vb.net), and I ask them for their credentials.

Then I create a user context like this :

Dim user As UserPrincipal
Using ctx As New PrincipalContext(ContextType.Domain, "MYDOMAIN", txtUsername.Text, txtPassword.Text)
     user = UserPrincipal.FindByIdentity(ctx, txtUsername.Text)
End Using

So I'm able to test user.Description, and I'm able to redirect them to another page with :

HttpContext.Current.Response.Redirect(urltoredirect)

But as its SharePoint, I redirect them to another site collection, so it's asking for their credentials. Creds that I've just asked them and I have in my code.

Is there a way to send these creds along with the redirection ? To create a kind of SSO ?

P.S: For more details, I'm trying to creating an custom login page, that will redirect user to a EULA Disclaimer & a Change Password page if this is their first visit, and if not, Redirecting them to their site collection according to their Description attribute. This is for extranet purpose.

EDIT1: I gave a try according to Making a web request to a web page which requires windows authentication but none if these solutions seem to work.

Community
  • 1
  • 1
Nico
  • 251
  • 1
  • 3
  • 13

1 Answers1

0

If you have access to SPUtility you can try one of the SPUtility.Redirect methods,

https://msdn.microsoft.com/en-us/library/Microsoft.SharePoint.Utilities.SPUtility_methods.aspx

Ethan
  • 144
  • 11
  • Thanks for answer, I read some stuffs about these methods, but I can't find where I send the Windows Credentials that ask the site (because it changes site collection while redirecting). I'm creating a kind of login page, so users enter their credentials in textbox and when they click "OK" I redirect them depending an AD Attribute – Nico Mar 17 '15 at 07:10