Skip to content
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

JWT support #16

Open
kavuri opened this issue Jul 4, 2017 · 4 comments
Open

JWT support #16

kavuri opened this issue Jul 4, 2017 · 4 comments

Comments

@kavuri
Copy link

kavuri commented Jul 4, 2017

I am trying to implement jwt support in sails-oauth2-api and trying to implement the seamless user registration (if the user does not exist in the local db)
I have added a check in isTrustedClient.js to verify if the grant_type is 'urn:ietf:params:oauth:grant-type:jwt-bearer'. From here onwards, I wanted to use https://github.com/xtuple/oauth2orize-jwt-bearer along with https://github.com/xtuple/passport-oauth2-jwt-bearer

Can you provide some pointers on the structure of the code and where I can go about implementing this? Once I am done, I can create a PR

@kavuri
Copy link
Author

kavuri commented Jul 5, 2017

Update: I have added support for JWT to verify the jwt token and also create a user if user does not exist. But I see that the jwt server.exchange('urn:ietf:params:oauth:grant-type:jwt-bearer', jwtBearer(function(client, data, signature, done) method does not get invoked in the flow as mentioned here: https://github.com/xtuple/oauth2orize-jwt-bearer
Any clue?

@lucj
Copy link
Owner

lucj commented Jul 5, 2017

@kavuri I've never used this one before. What is the headers you sent in the request that should trigger the exchange ?

@kavuri
Copy link
Author

kavuri commented Jul 5, 2017

@lucj the header is this urn:ietf:params:oauth:grant-type:jwt-bearer

@kavuri
Copy link
Author

kavuri commented Jul 5, 2017

@lucj I can create the PR, I need help in creating the flow. Currently, I have plugged the jwt verification in the isTrustedClient.js, but then it does not go to the access token generation once all the verification is complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants