Giter VIP home page Giter VIP logo

Comments (3)

hayfever avatar hayfever commented on June 15, 2024

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 @token = login_and_issue_token(@user.email, @user.password) for the unencrypted password and you should get a token back.

from sorcery-jwt.

sqlninja avatar sqlninja commented on June 15, 2024

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.
I then use that email to look up if we have a user in our system matching what twitter sent us.

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...

from sorcery-jwt.

joshbuker avatar joshbuker commented on June 15, 2024

JWT support will indeed be added to Sorcery v1, see Sorcery/sorcery-rework#9 for further discussion.

from sorcery-jwt.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.