Closed jk1z closed 6 years ago
You have to add all strategy names you want to use as a valid strategy
to the authenticate
hook at before
create
on the authentication
service.
Thanks for the help. I was following one of the FBSDK issue. It didn't mention you need to add strategy name into the before create authentication service at all. I guess that issue's solution is outdated?
Which issue is that?
Yes, it's the same thing, you just have to update the strategies
in your configuration to include the name of the strategy you want to use to authenticate. This is usually done in the authentication.strategies
section in config/default.json.
Anyway, thank you so much for the help. Also, since I saw on #22, we need an example or tutorial on how to setup the oauth token strategy. I took some time and made this article https://medium.com/@jackzhang0096/how-to-setup-oauth-2-0-token-strategy-on-feathersjs-1d77cc32118b. Hopefully, it will be useful when someone else stuck on the same problem.
Awesome, thank you so much for writing this up! I'm assuming we can close this then?
User cannot use Passport-Google-Token through POST request on /authentication. It works on the previous version of authentication-oauth2 which is the one without the '@'.
Steps to reproduce
Create a feathersjs app using feathersjs cli.
Add a users service and google login authentication through cli.
Modify the authentication.js and default.json a bit for adapting Passport-Google-Token.
Get Client secret and ID from google api console.
Get the access token from an app.
Post to /authentication with
{"strategy":"google", "access_token": "google access token"}
Response
Expected behavior
The application should return user a JWT token
Actual behavior
google strategy is not permitted.
System configuration
Module versions (especially the part that's not working): @featherjs/authentication: github:feathersjs/authentication @featherjs/authentication-oauth2: ^1.1.0
NodeJS version: 10.7.0
Operating System: Linux inside of nodejs docker image
Browser Version: Postman