How to get integrated credentials from anonymous access

Discussion in 'ASP .Net Security' started by Michael Ames, Nov 3, 2003.

  1. Michael Ames

    Michael Ames Guest

    I want to allow both anonymous and integrated access to a web service
    simultaneously. That is, if the calling user can be authenticated on the
    server, I want the calling user's username. If not, I still want them to be
    able to access the web service.

    The documentation suggests that this is not possible, because if IIS allows
    anonymous, it doesn't pass the caller's credentials on to ASP.NET. This
    must not be true, however, because I can allow anonymous in IIS, but set
    <deny users="?" /> in web.config and get the WindowsIdentity for the caller
    that way. So it seems to me that IIS *must* pass those credentials on to
    ASP.NET, which then makes the decision to reject the request if it's from an
    unrecognized user.

    So. Is there a way to "tap in" to that process, so that I can get the
    username of a recognized user, but still allow access by unrecognized users?

    Thanks!

    -Michael Ames
    Michael Ames, Nov 3, 2003
    #1
    1. Advertising

  2. Michael,

    try the following few lines of code on a suitable place:

    Response.StatusCode = 401;
    Response.StatusDescription = "Unauthorized";
    Context.ClearError();

    best regard



    Sascha
    Alexander Stojakovic, Nov 4, 2003
    #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. jadher
    Replies:
    1
    Views:
    3,577
    William F. Robertson, Jr.
    Oct 11, 2004
  2. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    Passing credentials to windows integrated authentication

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Oct 26, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    3,513
    Girish bharadwaj
    Oct 26, 2004
  3. Replies:
    5
    Views:
    3,154
    Nicole Calinoiu
    Jun 8, 2005
  4. Shimon Facterman

    Return credentials with anonymous authentication?

    Shimon Facterman, Aug 23, 2004, in forum: ASP .Net Security
    Replies:
    5
    Views:
    160
    Raterus
    Aug 25, 2004
  5. Daniel P.
    Replies:
    0
    Views:
    153
    Daniel P.
    Oct 20, 2006
Loading...

Share This Page