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

feat: Support other strategies #39

Open
DarkLite1 opened this issue Aug 31, 2020 · 5 comments
Open

feat: Support other strategies #39

DarkLite1 opened this issue Aug 31, 2020 · 5 comments
Labels
accepting help Issues open to PRs or contributions by others enhancement New feature or request

Comments

@DarkLite1
Copy link

Does graphql-passport also supports other strategies like say passport-azure-ad with its BearerStrategy?`

The documentation only mentions GraphQLLocalStrategy , that's why it's unclear to me.

@gforge
Copy link
Collaborator

gforge commented Aug 31, 2020

This should be doable but I've never worked with the more advanced strategies. The GraphQLLocalStrategy is implemented but it would be awesome if all of the strategies passport provides could be available.

@DarkLite1
Copy link
Author

Indeed, that would really be cool! So users can just use the standard available passport strategies and you don't need to replicate them and in turn avoid code duplication.

For the moment I'm following your guide to try and implement the passport-azure-ad strategie. The plan is to manually add the passport login and authenticate methods to the context just like your logout example in the guide.

I'm a bit of a newbee to web development, so fingers crossed :)

@PacomeRivier
Copy link

Hello, I'm trying to do the exact same thing, any update on how you managed to implement it @DarkLite1 ?

@DarkLite1
Copy link
Author

I couldn't wait for graphql-passport to support this feature so I used the standard passport to set up authentication with Azure AD.

@jkettmann
Copy link
Collaborator

Hey @DarkLite1, @PacomeRivier. Sorry for keeping you wait. The biggest pain that graphql-passport solves is local authentication with email and password. That's what the GraphQLLocalStrategy is for. Other strategies can be used in the normal way with passport.

If you're looking for an example you can see this blog post. Here is the final repository that combines the Facebook Strategy with local email/password.

If you don't use local email/password to authenticate the only thing you might use from this package is the buildContext function as you can see here. This basically just copies some of the passport functions like authenticate, login, logout and so on into the GraphQL context. So you might not necessarily need to use this package if you don't use local email/password.

@jkettmann jkettmann added the question Issues that are just requesting information label Jan 6, 2021
@ericbf ericbf added enhancement New feature or request accepting help Issues open to PRs or contributions by others and removed question Issues that are just requesting information labels Dec 21, 2022
@ericbf ericbf changed the title Support other strategies feat: Support other strategies Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting help Issues open to PRs or contributions by others enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants