1

I have a Visual Studio solution with 3 websites. Each website is a sub-domain on the live server. The login website is using the new claim based Identity authentication with OAuth.

So:

Website A = Admin (admin.domain.com)

Website B = Identity Portal for logins (login.domain.com)

Website C = Normal visitor website (www.domain.com)

This work very well on the live server by specifying the authentication cookie on website B to be for sub-domains, ".domain.com".

My question is, if i run the project in Visual Studio, how can i login on website B and stay logged in over website A and C? (I can not set the cookie to localhost since they all use their own port e.g, localhost:2245.)

I also do not want to create separate login forms on website A and C just for Visual Studio debugging.

1

1 Answer 1

3

Write your sites in hosts file (c:\Windows\System32\drivers\etc\hosts) Like this:

127.0.0.1     admin.domain.com
127.0.0.1     login.domain.com
127.0.0.1     www.domain.com

You can use any domain name (not real one). Then configure your IIS bindings as usual (all 3 names for one web site) and you will be able to open all these "virtual" sites in your browser, have different cookies, etc. You will need full IIS for this, not IIS express.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.