Using Authorize attribute in .NET MVC with custom authentication

Here is how you can use Authorize attribute in .NET MVC to authenticate and authorize user requests.