title: Oauth auth for Umbraco frontend
body: <p>I need to implement OAuth2 login on my Umbraco website for the frontend part.</p>
  
  <p>I have found a lot of information and tutorials of how to do this on the backoffice part, but none of them describes how to do it in the frontend.</p>
  
  <p>I am gonna use an inhouse Oauth2 authorization server.</p>
  
  <p>I have the following questions right now:</p>
  
  <ol>
  <li>I need help writing the template code. Could just be a button saying 'login' but how do I hook it up to the authentication middleware?</li>
  <li>Our OAuth2 implementation returns a JWT token that contains a users rights. Is it possible to protect views according to the specified rights in the JWT?</li>
  </ol>
  
  <p>Any help is appreciated.</p>