-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retrieve token #10
Comments
It seems like in the code you gave you're using the encrypted password, I actually haven't used sorcery in a while but I believe you do |
Yeah under a normal login flow that is accurate, we would receive the email/pw from the user. But with oAuth the user has logged on using a 3rd party (Twitter in my case), to which the twitter oauth callback just passes me the email (and other twitter related data) on the authenticated user. When the user is found I know have the activerecord instance of this user, but I need to pass back a response that includes the JWT token, so the apps/web can make subsequent authenticated calls. This may not be possible with this gem, since it seems to be only generating a token based on a payload that includes both the email & pw... Also, it appears there are discussions going on in Sorcery about including JWT tokenization natively, so this may be a moot point and not worth the effort here. Just though I'd asking if there was a way to get the token on a "known" user... |
JWT support will indeed be added to Sorcery v1, see Sorcery/sorcery-rework#9 for further discussion. |
If I already have a user, say from an oauth login, is it possible to retrieve the token for that user?
I tried
@token = login_and_issue_token(@user.email, @user.crypted_password)
but that just returns nil.
The text was updated successfully, but these errors were encountered: