Any document about how to use OAuth in client side?
I read the document about OAuth in parse server. But could not find the corresponding document how to use OAuth in client side. Any idea? Thanks.
I also ask for some doc without success. This article looks outdated https://parse.com/tutorials/adding-third-party-authentication-to-your-web-app I use the js client SDK. For all I can understand, you have to use a third party lib, like redux-auth (in my case) or hello.js and get a token, then you pass that token to parse-server (with the name of the provider), whose job is to return a Parse User.
Looks like the client SDKs (at least javascript) support passing in your own authentication provider... Here's the simplest example from a test scenario: https://github.com/ParsePlatform/Parse-SDK-JS/blob/bb78dfb4248afcb457acbebb24f2dc583d7c14bd/src/tests/ParseUser-test.js#L576 The authenticate method would be your third party code to get the proper token, and it returns the authData object for that provider..
Thx With this and the source of ParseUser (https://github.com/ParsePlatform/Parse-SDK-JS/blob/master/src/ParseUser.js) , we can manage something.
@oallouch There is a function in Javascript SDK. logInWith(provider, options). But what is provider and what is the options. Any sample code? Thanks.
I tried:
Parse.User.logInWith("facebook",{})
.then(user => {
alert(user);
},error => {
alert(error.message);
});
But got the following error:
TypeError: Cannot read property 'authenticate' of undefined
Nope, not for now. I postponed this part to end of my project :)
Closing here as you opened on ParsePlatform/Parse-SDK-JS#246
@flovilmart @oallouch Any one can provide client side i.e jQuery example for FB or Twitter? How can i get this Auth setup from server? An example will be greatly appreciated.
Thanks
The Rest guide has full examples for cUrl that should be trivial to port to jQuery http://parseplatform.github.io/docs/rest/guide/