1

From the client, is there a way to get a true/false value from an asp.net page to show you have authorization to access the page. Using Forms Authentication I get redirected to a login page. I just need a simple boolean.

Aaron

2 Answers 2

1

I would go for User.Identity.IsAuthenticated

Sign up to request clarification or add additional context in comments.

1 Comment

But the question was for authorization, not authentication.
0

All of these methods that are mentioned are Server Side Asp.net Calls. If you would want to do this from the client side I would create a Generic Handler to wrap the Page.User.IsInRole("YourRoleName") or System.Web.HttpContext.Current.User.IsInRole("YourRoleName") calls.

Then you could just use javascript to call the handler and return the result.

1 Comment

Very good. I think this is what I need. I just had to add a <location path=blah.ashx> tag in web.config to allow unauthenticated acesss to the .ashx file. Does anyone see any security issues with this if the .ashx file just returns true or false?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.