title: Doorkeeper, OAuth, JWT with Rails
body: <p>I've already looked at dedicated Rails casts <a href="http://railscasts.com/episodes/353-oauth-with-doorkeeper?view=asciicast" rel="nofollow noreferrer">here</a> and
  <a href="http://railscasts.com/episodes/235-omniauth-part-1" rel="nofollow noreferrer">there</a>, as well some <strong>Rails API</strong> tutorials with <strong>JWT</strong> <a href="https://scotch.io/tutorials/build-a-restful-json-api-with-rails-5-part-two" rel="nofollow noreferrer">here</a> and <a href="https://dev.mikamai.com/2015/03/02/oauth2-on-rails-the-client-application/" rel="nofollow noreferrer">there</a> and <a href="https://www.bignerdranch.com/blog/oauth2-and-so-can-you/" rel="nofollow noreferrer">here</a>. Unfortunately, most of them are too outdated (2011-2015).
  Nevertheless, I'm a still a little bit lost what to choose between <a href="https://github.com/oauth-xx/oauth2" rel="nofollow noreferrer">oauth2</a>, <a href="https://github.com/omniauth/omniauth-oauth2" rel="nofollow noreferrer">omniauth-oauth2</a>, <a href="https://github.com/jwt/ruby-jwt" rel="nofollow noreferrer">ruby-jwt</a>
  and in which situation and how to glue all these bricks together.</p>
  
  <p>To be short, I need to <strong>authenticate Users</strong> via an external corporate API, get <strong>JWT token</strong> and be able to decode it to extract User information
  before let him enter the Rails application.
  What should I do: </p>
  
  <ul>
  <li>create a custom strategy ? </li>
  <li>will this custom strategy work with the corporate authentication API
  if it does not use Doorkeeper ?</li>
  </ul>
  
  <p>Some recent links would be really appreciated.</p>