Redirecting to a website using basic authentication

Discussion in 'ASP .Net' started by =?Utf-8?B?c3VyZXNocGFuZGk=?=, Nov 7, 2007.

  1. 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
    =?Utf-8?B?c3VyZXNocGFuZGk=?=, Nov 7, 2007
    #1
    1. Advertising

  2. 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



    "sureshpandi" wrote:

    > 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
    >
    >
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Nov 7, 2007
    #2
    1. Advertising

  3. 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

    "Peter Bromberg [C# MVP]" wrote:

    > 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
    >
    >
    >
    > "sureshpandi" wrote:
    >
    > > 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
    > >
    > >
    =?Utf-8?B?c3VyZXNocGFuZGk=?=, Nov 7, 2007
    #3
  4. =?Utf-8?B?c3VyZXNocGFuZGk=?=

    bruce barker Guest

    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)


    sureshpandi wrote:
    > 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
    >
    >
    bruce barker, Nov 7, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brett Porter
    Replies:
    2
    Views:
    756
    Andrea D'Onofrio [MSFT]
    Jan 20, 2004
  2. Pradeep Pise
    Replies:
    0
    Views:
    526
    Pradeep Pise
    Jul 9, 2004
  3. jose
    Replies:
    1
    Views:
    301
    Cowboy \(Gregory A. Beamer\)
    Jan 27, 2009
  4. ohaya
    Replies:
    0
    Views:
    170
    ohaya
    Mar 16, 2005
  5. jose
    Replies:
    1
    Views:
    125
    Bob Barrows
    Jan 27, 2009
Loading...

Share This Page