title: How do I effectively use Devise and Doorkeeper in my rails API?
body: <p>I am having a hard time getting my head around the responsibilities and capabilities of the popular Doorkeeper and Devise gems. I am not overly experienced in authorization and authentication so pardon me if I misunderstood certain aspects of those areas. I do try hard and if I do something I want to do it the right way, so here is my current situation:</p>
  <p>I want to build an API-only rails application that is responsible for authenticating and authorizing users as they sign up and use the service. I handpicked two fairly popular gems called Doorkeeper (authorization) and Devise (authentication).</p>
  <p>I currently have this structure in place and it works, however, I'm having issues fully getting behind what the responsibilities of these gems are. So as far as I understand, the Devise gem serves as an authentication layer, meaning that the user can be identified and logged in (additional features will be discussed below). Doorkeeper on the other hand will ensure that resources can only be accessed by members who are authorized to do so. I have chosen Doorkeeper for OAuth2 integration because my server needs to be able to give access to the API to potential third parties in the future.</p>
  <p>My question first and foremost is whether my assumptions about those gems is correct.</p>
  <p>Here is the current authentication/authorization flow:</p>
  <p><strong>Issue</strong>: User signs up, how do I leverage Devise to send a confirmation email if my API is devoid of the preconfigured views provided by Devise? <em>(Side Note: The traits Recoverable, Rememberable, Trackable, and Confirmable are in the User model/migration.)</em></p>
  <p><em>Similarly, I would love to know how to implement a potential password reset. Notice that references to examples would suffice too as long as they are applicable to my use case.</em></p>
  <p>I know that Devise offers these capabilities, but it's hard to make out how to do it without hitting their preconfigured (view?) routes.</p>
  <p>For example, when a user signs up, he hits my own <code>user_controller</code>'s create method, which basically just creates a new user, is that supposed to automatically send a confirmation email (if we assume that my mail config is correct)?</p>
  <p>I am not entirely sure whether avoiding the preconfigured routes makes a lot of sense, that's why I'd like to hear from more experienced people who may have used those gems in the past if my thinking is correct or whether I'm completely off on this.</p>