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

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

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

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. Mike Newton
    Replies:
    0
    Views:
    3,132
    Mike Newton
    Jul 23, 2004
  2. nalbayo
    Replies:
    2
    Views:
    5,829
    Bruce Barker
    Nov 11, 2005
  3. Peter Bons
    Replies:
    1
    Views:
    607
    Patrick.O.Ige
    Mar 31, 2006
  4. Replies:
    4
    Views:
    5,280
    Roedy Green
    Sep 30, 2005
  5. Electrified Research
    Replies:
    3
    Views:
    745
    Electrified Research
    Sep 23, 2006
  6. Dwight Johnson

    HttpContext.Current.User returns old user id

    Dwight Johnson, Feb 16, 2010, in forum: ASP .Net
    Replies:
    1
    Views:
    1,496
    Alexey Smirnov
    Feb 28, 2010
  7. mvr
    Replies:
    5
    Views:
    691
    Aaron Bertrand [SQL Server MVP]
    May 16, 2006
  8. Jack
    Replies:
    3
    Views:
    871
    Tad J McClellan
    Dec 22, 2008
Loading...