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

Using social strategies with sessionless jwt strategy #55

Closed
edulis8 opened this issue Mar 28, 2016 · 10 comments
Closed

Using social strategies with sessionless jwt strategy #55

edulis8 opened this issue Mar 28, 2016 · 10 comments

Comments

@edulis8
Copy link

edulis8 commented Mar 28, 2016

Hi,
I would be greatly helped and appreciative if there were an available example of how to implement jwt and social (in my case, instagram) strategies in a sessionless approach, for an app where routing is being handled by the frontend.

Thanks!

@gabosdk
Copy link

gabosdk commented Apr 19, 2016

@angelxmoreno
Copy link

Is this still needed? I am working on an API that does the initial authentication ( log in ) via Github then passes the JWT token to the front-end. On subsequent requests to the api, the front-end passes the JWT to authenticate the user.

@edulis8
Copy link
Author

edulis8 commented Apr 23, 2016

Absolutely a needed thing, I'm done working on my project (sent the JWT to the client-side via query string in the callback url after Instagram authentication, kind of an ugly hack)...

@angelxmoreno
Copy link

angelxmoreno commented Apr 24, 2016

This can be tricky since a good example would include the backend and a frontend. I currently use AngularJS 1.x as a frontend with the ng-token-auth module. For the backend I use ExpressJS and Sequelize as an ORM. If those requirements are to your satisfaction, I could put something together.

@TD-Stanley
Copy link

I'd be interested to see someone's take on this. I've seen various piecemeal articles online.

@angelxmoreno
Copy link

I'll slap something together tonight.
Backend: Express, Sequelize, Passport
Frontend: Angular, NG-Token-Auth

@Kannaj
Copy link

Kannaj commented Jun 20, 2016

@angelxmoreno - did you manage to figure it out? i'm trying to do something similar for a react app

@imakshath
Copy link

I need the same sample which fulfils below requirement.

I am using express typescript along with routing-controller module. I have to implement jwt and some of social auth using passport. Is there any samples which handle both email password/ social using passport-jwt authentication ? How can i implement this ? Its really confusing.

@Kannaj
Copy link

Kannaj commented Nov 25, 2016

I just ended up hijacking githubStrategy and created jwt for each user through oAuth .

https://github.com/Kannaj/42EXP/blob/master/server/passport/passport_github.js#L31

@mikenicholson
Copy link
Owner

Closing as this is out of scope of this module.

There have been several answers with examples of social login strategies.

@akshath4u There is a good jist in which the author of the passport framework provides his suggestion on how to handle multiple authentication strategies in the same applicaiton: https://gist.github.com/joshbirk/1732068

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

No branches or pull requests

7 participants