Directly Accessing a Principal Object

A

Adam Getchell

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top