Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I'd like to make a redirect to another website which have a Basic Authorization (pop up asking for username and password)

for me i know the authorization header content which is like
Authorization:Basic trityrkyjhtjyrtytrtytry== , the Base64 encryption is for the "username:password" combination, what i'm looking for is to redirect from the server side (ASP.net C#) to website URL and pass the authentication header to auto login to the website.

is there's any way to pass the header and redirect without popup asking for the username and password.

this is single sign on mechanism needed between 2 portals.

Thanks in advance
Posted
Updated 28-Mar-11 10:28am
v2
Comments
avigodse 29-Mar-11 10:11am    
A little correction, Base64 is not encryption but its Encoding.
Encryption are 64, 128, 256 bit and so on, as per your project requirement.

1 solution

First thing, if you are having single sign-on requirement for multiple portals or websites, then its always better to have Out-Proc state management design to save user sessions, at state-server or in db-server.

And if you are looking for very quick fix to your problem then read below.

Instead of using log-on using login page, redirect to landing/home page with encoded query string parameters.
Design the receiving page for decoding those provided parameters and forward them for authentication.
Apply session validation logic in each page using user control or master page.
If session is available for user parameters then continue to navigate to landing/home page or other page.
If session is not available and user parameters are valid then create session for the user on that portal.
If user parameters are not valid redirect to authentication error page.

This can be the logical approach, for better results go for best practices and better design standards.
 
Share this answer
 
v2
Comments
zingoraa 29-Mar-11 10:59am    
if this could have been better if supported by example.
yet good answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900