How to retrieve current Windows User Handle from ASP

Discussion in 'ASP General' started by Stefano, Oct 12, 2004.

  1. Stefano

    Stefano Guest

    Hi all,

    is it possibile to retrieve the current Windows User Handle from ASP code?

    I would like to retrieve the correspondent in ASP for thi piece of ASP.NET
    code:

    WindowsIdentity id = HttpContext.Current.User.Identity as WindowsIdentity;
    if (id != null)
    {
    IntPtr handle = id.Token;
    }

    I need to pass "handle" variable to a .NET method (using interop).

    Thank you so much.

    Bye
     
    Stefano, Oct 12, 2004
    #1
    1. Advertising

  2. Stefano

    Ken Schaefer Guest

    I don't think ASP provides any intrinsic way to access the user token - you
    might be able to do it in a COM object.

    Cheers
    Ken

    "Stefano" <> wrote in message
    news:OC%...
    > Hi all,
    >
    > is it possibile to retrieve the current Windows User Handle from ASP code?
    >
    > I would like to retrieve the correspondent in ASP for thi piece of ASP.NET
    > code:
    >
    > WindowsIdentity id = HttpContext.Current.User.Identity as WindowsIdentity;
    > if (id != null)
    > {
    > IntPtr handle = id.Token;
    > }
    >
    > I need to pass "handle" variable to a .NET method (using interop).
    >
    > Thank you so much.
    >
    > Bye
    >
    >
     
    Ken Schaefer, Oct 12, 2004
    #2
    1. Advertising

  3. Stefano

    Stefano Guest

    I use Basic Authentication (over SSL), so I retrieved the Base64 string from
    ASP code, using HTTP_AUTHORIZATION servervariable.

    In this way, I can decode the string and so I can have the user's
    credentials.

    So, I solved my problem.

    But... I'm curious... what about retrieving user token by COM object?

    Thanks!

    Bye


    "Ken Schaefer" <> ha scritto nel messaggio
    news:%...
    > I don't think ASP provides any intrinsic way to access the user token -

    you
    > might be able to do it in a COM object.
    >
    > Cheers
    > Ken
    >
    > "Stefano" <> wrote in message
    > news:OC%...
    > > Hi all,
    > >
    > > is it possibile to retrieve the current Windows User Handle from ASP

    code?
    > >
    > > I would like to retrieve the correspondent in ASP for thi piece of

    ASP.NET
    > > code:
    > >
    > > WindowsIdentity id = HttpContext.Current.User.Identity as

    WindowsIdentity;
    > > if (id != null)
    > > {
    > > IntPtr handle = id.Token;
    > > }
    > >
    > > I need to pass "handle" variable to a .NET method (using interop).
    > >
    > > Thank you so much.
    > >
    > > Bye
    > >
    > >

    >
    >
     
    Stefano, Oct 12, 2004
    #3
    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. Valerian John

    How to retrieve current page name

    Valerian John, Aug 20, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    590
    MS News \(MS ILM\)
    Aug 20, 2003
  2. HaukiDog
    Replies:
    0
    Views:
    478
    HaukiDog
    Mar 7, 2004
  3. Replies:
    4
    Views:
    5,187
    Roedy Green
    Sep 30, 2005
  4. mvr
    Replies:
    5
    Views:
    583
    Aaron Bertrand [SQL Server MVP]
    May 16, 2006
  5. Jack
    Replies:
    3
    Views:
    663
    Tad J McClellan
    Dec 22, 2008
Loading...

Share This Page