Persist impersonated NT credentials across pages

Discussion in 'ASP .Net Security' started by Eric, Apr 20, 2006.

  1. Eric

    Eric Guest

    Hello,

    I am trying to build a web app that sits "on top" of SharePoint, but I am
    having trouble with the Windows login. Here is what I want to accomplish:

    1. The user will log into my application using non-NT credentials (stored in
    DB).
    2. My code then determines if this person is (for simplicity's sake) a User
    or Admin.
    3. If a User, I want to log into the Windows domain using the SP_USER domain
    account.
    4. If Admin, login using SP_ADMIN.
    5. Then, I will link over to the SharePoint portal, having the SP_USER or
    SP_ADMIN credentials "automagically" passed.

    I am having problems with steps 3 and 4. When you manually log into a page
    using NT credentials--then link over to SharePoint--the Windows credentials
    are automatically passed.

    However, impersonated credentials fall out of context immediately after that
    code block is finished executing. (The source code that I used is similar
    to: http://support.microsoft.com/default.aspx?scid=kb;en-us;306158.)

    So my question, what API calls are needed to either:
    - Store or otherwise persist the impersonated credentials to out-of-context
    pages
    OR
    - Programmatically perform a TRUE Windows domain login without user
    intervention, so that credentails are automatically passed to another page
    without a Windows login prompt?

    Thank you!

    Eric
     
    Eric, Apr 20, 2006
    #1
    1. Advertising

  2. you can always cache the WindowsIdentity with System.Web.Cache....

    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > Hello,
    >
    > I am trying to build a web app that sits "on top" of SharePoint, but I
    > am having trouble with the Windows login. Here is what I want to
    > accomplish:
    >
    > 1. The user will log into my application using non-NT credentials
    > (stored in
    > DB).
    > 2. My code then determines if this person is (for simplicity's sake) a
    > User
    > or Admin.
    > 3. If a User, I want to log into the Windows domain using the SP_USER
    > domain
    > account.
    > 4. If Admin, login using SP_ADMIN.
    > 5. Then, I will link over to the SharePoint portal, having the SP_USER
    > or
    > SP_ADMIN credentials "automagically" passed.
    > I am having problems with steps 3 and 4. When you manually log into a
    > page using NT credentials--then link over to SharePoint--the Windows
    > credentials are automatically passed.
    >
    > However, impersonated credentials fall out of context immediately
    > after that code block is finished executing. (The source code that I
    > used is similar to:
    > http://support.microsoft.com/default.aspx?scid=kb;en-us;306158.)
    >
    > So my question, what API calls are needed to either:
    > - Store or otherwise persist the impersonated credentials to
    > out-of-context
    > pages
    > OR
    > - Programmatically perform a TRUE Windows domain login without user
    > intervention, so that credentails are automatically passed to another
    > page
    > without a Windows login prompt?
    > Thank you!
    >
    > Eric
    >
     
    Dominick Baier [DevelopMentor], Apr 21, 2006
    #2
    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. Warren J. Hairston

    Persist a stack across PostBacks?

    Warren J. Hairston, May 11, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    372
    Jason DeFontes
    May 11, 2004
  2. =?Utf-8?B?U2lvYmhhbg==?=

    Persisting user login credentials across pages

    =?Utf-8?B?U2lvYmhhbg==?=, Feb 20, 2005, in forum: ASP .Net
    Replies:
    19
    Views:
    838
    =?Utf-8?B?U2lvYmhhbg==?=
    Feb 28, 2005
  3. Godwin Burby
    Replies:
    3
    Views:
    1,760
    Godwin Burby
    Mar 17, 2006
  4. Stan Rawrysz

    Credentials persist after CredentialCache.Remove()

    Stan Rawrysz, Apr 14, 2005, in forum: ASP .Net Security
    Replies:
    0
    Views:
    147
    Stan Rawrysz
    Apr 14, 2005
  5. Parag Gaikwad
    Replies:
    18
    Views:
    370
    Parag Gaikwad
    Jul 26, 2007
Loading...

Share This Page