-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Adds generic support additional OAuth providers #247
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
Conversation
@flovilmart updated the pull request. |
Twitter is a bit trickier because it requires header signature with OAuth1. |
@flovilmart updated the pull request. |
@nlutsenko there seems to be a problem with the test suite as it randomly fails after downloading a certain version of mongo-db... Not sure what's happening here. |
@flovilmart updated the pull request. |
4 similar comments
@flovilmart updated the pull request. |
@flovilmart updated the pull request. |
@flovilmart updated the pull request. |
@flovilmart updated the pull request. |
Twitter is giving me some pain... Stupid OAuth 1.0 |
@flovilmart updated the pull request. |
This is beautiful. 👍 |
@gfosco, I'll refactor to pass just authData and options to both validation calls, it will be cleaner and more extensible |
@flovilmart updated the pull request. |
@gfosco refactor is done, adds ability also to pass custom modules as validators :) that will help with extensibility. And obviously is covered by tests. |
+1 |
|
+1 |
hi @flovilmart I using like that. curl -X POST response come like that { What is my wrong ? Thank you |
@kkaradag2 I didn't test with the REST API, I'll add the according Unit tests to make sure that work. please stay tuned! |
@flovilmart updated the pull request. |
@flovilmart I finaly run twitter register. I notice that, git clone come someting is wrong or miss. I read carefully your comments and changes so I created a running version on m local. |
@kkaradag2 does your bug reproduces with Facebook as well? this is maybe a more generalized bug |
I didn't try to create a user with Facebok. May be yes this is a general problem with oauth. Because normal registration (username and password one) say oauth registration needs same control. Thank you |
Hey total beginner here. How might one utilize this via the iOS/Android Client SDK's? |
@FridayDevGroup there is a gist there: https://gist.github.com/flovilmart/68a6c538496953408bb1 with the example for the twitter login |
@flovilmart updated the pull request. |
Refactors facebook login into oauth generic login Adds additional oauth2 providers adds ability to pass an oAuth validator in the config Adds Twitter validation support + OAuth 1 client Support auth_token instead of access_token for twitter Improves code coverage of OAuth Adds validation of oauth provider structures Better coverage of the OAuth spec 100% coverage of OAuth1.js Adds passing auth_token_secret for Twitter auth. Refactors auth validation methods to include authData parameter - Adds ability to extens oauth validator through configuration - Adds ability to extend oauth validator through external module (file or package) - Adds more tests - Adds tests to login with custom auth provider Adds more tests for REST API fixes twitter auth_token f
@flovilmart updated the pull request. |
@flovilmart Thank you very very much. That example is gorgeous. So for the Twitter users currently registered to my app, this will query and return the user account created pre-migration? Apologies if the answer to that is ubiquitous. |
@FridayDevGroup it definitely should. The original SDK also pass the consumer_key and consumer_secret alongside the authData, you can pass them also but that's optional as the token verification is made based on the oauth configuration as described in the readme. |
@flovilmart Awesome, thank you. I'm going to get going with all of this soon. About the readme, I tried to take a look at the example links you dropped in there earlier and they're all returning 404. I think they may have gotten moved around when the Parse-Server folder restructuring pr got merged, but I couldn't track down the new locations. |
@FridayDevGroup it's because it's not merged yet :) On another point, you should not need those links :) |
@flovilmart Yeah.. I had a feeling it was my own misunderstanding haha. Thanks again for the guidance. |
no problemo! |
Hello @flovilmart I'm not sure if this issue is related with oAuth specifically or the parse save function but here's what I'm facing. I'm trying to link a Twitter account to an existing parse account using Cloud Code and I'm getting a It seems a request.user.save() function when run within Cloud Code does not pass the sessionToken in this case. Here's my original request:
Here's the request made on request.user.save() in cloud code
Here's my cloud code
Specifying a master key too doesn't help and I still get the 206 error code which is for missing sessionToken. |
I don't think you can explicitly set authData like that. What does the JS SDK suggest for linking? |
Just tried it again with Anyhow this issue thankfully isn't related to this pull request, hope this gets merged asap. |
Can you try on the master branch with a Facebook auth data? See if it's a regression or not. |
Looks awesome! Thanks a lot @flovilmart |
Adds generic support additional OAuth providers
🎉 ! |
Whee!! We finally have it! |
Ahah! I'm drinking a beer to cheer on that! 🍻 for everyone at Parse HQ! |
What about adding documentation for this? |
Lots going on here but not enough documentation, so is the new syntax for index.js as such:
|
oauth is deprecated in favor of auth. |
Does that mean Parse Server (2.3.0+) doesn't support Twitter login? I thought this was covered in this PR |
It just means that parse-server prefers the auth option instead of oauth. It doesn't change what's supported, just the option name. |
Proposed fix for #241 and #40
Adds additional OAuth providers, may need a refactor to reduct the boilerplate request code.
No coverage of the network request, needs to be tested against real keys and tokens unfortunately.
Because Facebook auth validation is refactored, the methodology should work for all other providers.