Logging onto IIS programatically
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Logging onto IIS programatically

Hybrid View

  1. #1
    Join Date
    Feb 2009
    Location
    Chicago
    Posts
    4

    Logging onto IIS programatically

    Hi,

    I have a secure site that uses NT domain authentication.
    Someone else wants to create a link on their website to access mine.
    However, currently when they execute
    Response.Redirect("my domain and page go here");
    they get the Windows log-in pop up asking them for NT credentials.
    This user has a valid NT login and password on our domain, but is there a way for them to integrate into their Redirect statement.
    Alternatively, can they do something to get around seeing a pop-up dialogue box asking them to log in every time?


    Thanks
    Last edited by cjard; April 12th, 2009 at 03:39 AM. Reason: email removed to reduce your spam visibility

  2. #2
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104

    Re: Logging onto IIS programatically

    Erm.. the user has authenticated with your domain, and you want to redirect the browser off to another domain, bypassing that domain's security prompt. Are you surprised it does not work? I think you'll ahve to make it server based redirecting: the client stays communicating to your domain and your domain fetches the data from the other domain on their behalf (proxying)
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

  3. #3
    Join Date
    Feb 2009
    Location
    Chicago
    Posts
    4

    Re: Logging onto IIS programatically

    I was hoping it doesn't have to come to proxying data.
    Just to point out a couple of things:
    - The user has a valid log-in credentials to both of the websites. Once the user clicks the link to my website, his log-in information can be looked up in a database on that end and programatically generated.
    - The question remains how can this log-in information be injected into the HTTP request
    towards my site, so the user does not receive the 401 challenge?
    - My IIS server is using Basic authentication.

    Thank you

  4. #4
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    47

    Re: Logging onto IIS programatically

    Is this "web request using basic authentication"?

    http://www.ie-soft.de/blog/PermaLink...ea46339f6.aspx

    I wonder whether this work with Microsoft IIS...
    Xander Tan

  5. #5
    Join Date
    Feb 2009
    Location
    Chicago
    Posts
    4

    Re: Logging onto IIS programatically

    Hi,

    @xander_tan: Yes, your solution will work in IIS, however it is not quite what I need to happen.
    I tried to build an HttpWebRequest to the page and pass a NetworkCredential to the request.
    That will log me in to the server and request the html of the page.
    However I cannot use this for two reasons
    1) The web site I'm requesting is composed of several frames, each frame being a different page which is not evaluated in the html that is returned.
    2) This credential request is not cached by the browser, and subsequent redirects/requests to the server will need to have the "Authorization" header added as well. Most browsers will append the header once the basic authentication credentials are cached. Unfortunately, this doesn't do it.

    I'm looking into using Ajax to do an http request where i can manipulate the headers. Will post when i get it to work.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center