How do I authenticate using Devise in a Rails REST API App?
<p>I'm creating a Rails app which have both a GUI part, and a REST/JSON-API.</p>

<p>The REST/JSON API is fairly simple, and the controller returns data like this:</p>

<pre><code>def get_players
    @players = Player.all
    render json: @players
end
</code></pre>

<p>The GUI part of the app is using Devise for authentication, and it works fine.</p>

<p>Now I want to add authentication for the REST/JSON Api too, how do I do that?</p>

<p>Also, how do I test the REST API using curl when the Authentication is added? </p>

<p>---- edit ----</p>

<p>as it turns out, Devise wasnt necessary in this case. A home-cooked token-authentication method works for now. (token created when Player is created, and returned on correct e-mail/password combo).</p>