Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / November 2007

Tip: Looking for answers? Try searching our database.

Redirecting to a website using basic authentication

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sureshpandi - 07 Nov 2007 18:40 GMT
Hi



I am in a web site A. I want to redirect to a web site B with basic
authentication. HttpWebContext and WebRespose methods are downloading a site
page as html and this is not helping me. I dont want to get the HTML , i want
to redirect to the web site b with basic authentication.

I appreciate if some one helps me to solve this problem.

Thanks in advance.



Suresh
Peter Bromberg [C# MVP] - 07 Nov 2007 19:01 GMT
Well, you redirect with Response.Redirect method.  Depending on whether the
authentication is set up, you could do:
Response.Redirect("Http://username:password@othersite/otherpage.aspx");

-- Peter
http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder:    http://www.blogmetafinder.com

> Hi
>
[quoted text clipped - 12 lines]
>
> Suresh
sureshpandi - 07 Nov 2007 19:47 GMT
Thanks Peter

I read some article like that
"Microsoft released a security patch that disables passing the credentials
in the url.."

I have tested and it is not working if i pass credentials thru URL.

Someone suggested to use the following,

Page.Response.AddHeader("AUTH_USER", "User")
Page.Response.AddHeader("AUTH_PASSWORD", "password")
Server.Transfer("default.aspx")

The above is also not working for the case
Server.Transfer("http://siteb/onlinedocs/webpage.aspx")

It will be helpful if you give me any other way to redirect to different
site using basic authentication.

Thanks
Suresh

> Well, you redirect with Response.Redirect method.  Depending on whether the
> authentication is set up, you could do:
[quoted text clipped - 21 lines]
> >
> > Suresh
bruce barker - 07 Nov 2007 20:32 GMT
there is no way to do this without a custom browser.

the most common approach is to pass a login ticket in the url to site b,
then they call back to site a to get the credentials. site b would still
not be able to use basic authentication.

the second approach is to reverse proxy site b. instead of redirecting,
your site fetches the site b page (with basic authenication) and
forwards them. your reverse proxy will usually have to edit the html for
any embedded url's if they refer to site b's domain name (also /path can
give problems).

-- bruce (sqlwork.co)

> Hi
>
[quoted text clipped - 12 lines]
>
> Suresh

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.