A more MVCish way to achieve this is to write a custom AuthorizeAttribute and accomplish this by overriding OnAuthorization instead of Application_AuthenticateRequest .
Having said that, I think your implementation is not bad. As an alternative to storing additional information in the cache, you can save it in the userData part of the userData ticket, if this information is not very large, of course. Both approaches are viable. If you decide to go with caching, I would recommend that you upload it to dedicated cache servers, and not store it in the memory of web servers.
Darin Dimitrov
source share