Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing Devise tokens to log in, is this built in?
    primarykey
    data
    text
    <p>So, I'm trying to use tokens with Devise (version 1.0.3 with Rails 2.3.8) to let a user log in, but I'm not entirely sure where to begin.</p> <p><a href="http://zyphdesignco.com/blog/simple-auth-token-example-with-devise" rel="noreferrer">http://zyphdesignco.com/blog/simple-auth-token-example-with-devise</a></p> <p>The above tutorial helped me turn on the token functionality, and showed how to generate (or delete) tokens...but the whole POINT of tokens is to use them to authorize a user, correct?</p> <p>When I look at a user in the console, I can say user.authentication_token, and get something back like: "Qm1ne93n_XkgmQTvxDmm", which is all well and good...but where do I go from there?</p> <p>I tried hitting the sign_in root using the following command line command:</p> <blockquote> <p>curl -d "authentication_token=Qm1ne93n_XkgmQTvxDmm" localhost:3000/users/sign_in</p> </blockquote> <p>And definitely didn't get a successful log in. </p> <p>In the sessions controller, I see that they call:</p> <blockquote> <p>authenticate(resource_name)</p> </blockquote> <p>Which I'm ASSUMING is somewhere in the module:</p> <blockquote> <p>include Devise::Controllers::InternalHelpers</p> </blockquote> <p>which gets included, but I don't know where to look for that (it's definitely not in the source's controller folder). If I could look at how authenticate works, I could see if it even LOOKS at tokens...</p> <p>DOES Devise let you actually log in with tokens, or does it just have a framework for generating them? If it does let you log in with them...HOW do you do this? Can you not use curl (i.e. does it have to be in a browser? If so, I'd hafta roll my own solution, I NEED non-browser support.). If it doesn't, how do I roll my own?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload