IHttpModule and User.IsInRole

T

trullock

Hi,

Ive written a URLRewriter IHttpModule which all works fine.
I've come to make a change to it which involves deciding where to
redirect based on what role a user is in.
HttpContext.Current.User is null however in my ihttpmodule's
beginrequest event :(
Should it be? If so, is there a different event i can use where the
User does exist which doesnt fire too late to perfrom the rewrite?

Thanks

Andrew
 
G

Guest

Hi,

Ive written a URLRewriter IHttpModule which all works fine.
I've come to make a change to it which involves deciding where to
redirect based on what role a user is in.
HttpContext.Current.User is null however in my ihttpmodule's
beginrequest event :(
Should it be? If so, is there a different event i can use where the
User does exist which doesnt fire too late to perfrom the rewrite?

Thanks

Andrew

AuthenticateRequest
 
T

trullock

AuthenticateRequest

Hi,

Thanks for that suggestion, ive tried it and the user does exist at
that point, but .IsInRole("bla") always returns false, for all the
roles its supposed to be in :s

Any idea whats going on there?

Thanks

Andrew
 
T

trullock

Hi,

Thanks for that suggestion, ive tried it and the user does exist at
that point, but .IsInRole("bla") always returns false, for all the
roles its supposed to be in :s

Any idea whats going on there?

Thanks

Andrew

OK i've used AuthorizeRequest :)

Is that still and acceptable event in which to perfrom the rewrite?

Thanks

Andrew
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top