Directly Accessing a Principal Object

Discussion in 'ASP .Net Security' started by Adam Getchell, Mar 31, 2005.

  1. I've writting an httpModule to handle our custom authentication process,
    which uses site-wide kerberos.

    Currently, this means that each and every page causes authentication to
    occur. I'd like to short-circuit authentication if it's already happened by
    using something like:

    private void AuthenticateRequest(object requestObjectSender, EventArgs
    requestObjectEventArguments)
    {
    if (!Thread.CurrentPrincipal.Identity.IsAuthenticated)
    {
    HttpApplication objectApplication = (HttpApplication)requestObjectSender;
    HttpContext objectContext = (HttpContext)objectApplication.Context;
    .....

    For this to work, I need to have my GenericPrinciple setup here:

    objectContext.User = new GenericPrincipal(objectIdentity, stringRoles);

    have its IsAuthenticated property set to true.

    How would I do this? The article "Directly Accessing a Principal Object" in
    the .NET Framework Developer's Guide doesn't explain this, as far as I can
    tell. Are there other pointers?

    Thanks,
     
    Adam Getchell, Mar 31, 2005
    #1
    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. Craig Buchanan

    Principal/Identity questions

    Craig Buchanan, Dec 3, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    381
    John Saunders
    Dec 3, 2003
  2. =?Utf-8?B?Sm9u?=

    Principal and Identity

    =?Utf-8?B?Sm9u?=, Feb 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    370
    Teemu Keiski
    Feb 18, 2004
  3. Replies:
    2
    Views:
    1,666
  4. padma
    Replies:
    3
    Views:
    429
    Victor Bazarov
    Oct 5, 2007
  5. Replies:
    0
    Views:
    929
Loading...

Share This Page