delight-im / Android-DDP

[UNMAINTAINED] Meteor's Distributed Data Protocol (DDP) for clients on Android
Apache License 2.0
274 stars 54 forks source link

Authentication with Google, facebook, Twitter accounts #21

Closed ghost closed 8 years ago

ghost commented 9 years ago

Hello,

it's possible connect to meteor server with Google or Facebook account ?

tks

ocram commented 9 years ago

Thanks for your question!

Unfortunately, this is not yet supported by this library. Sorry! Meteor itself (for the web) supports this, of course.

Having access to the Meteor#call(...) method, however, you could probably implement this yourself, if you'd like:

To connect with the third-party service (e.g. Facebook), one must (most likely) make a separate HTTP request to get a login token. After that, you can then use that token in some method call to your Meteor server using Meteor#call(...).

Hope that helps!

cprakashagr commented 8 years ago

Hi, this is now possible with the new pull request I have made. Kindly check here, https://github.com/cprakashagr/Android-DDP/tree/GoogleLoginHandler

najeebullahshah commented 8 years ago

@cprakashagr can you please refer to the method which will connect to meteor server via facebook login

cprakashagr commented 8 years ago

@najeebullahshah there is no such custom methods for facebook or google login at meteor accounts. Kindly see my code and use the facebook login accordingly.

najeebullahshah commented 8 years ago

@cprakashagr if i am not wrong you added method "registerWithGoogle" to the DDP settings parameters using Map but it uses the following paramters

         accountData.put("email", email);
    accountData.put("userId", userId);
    accountData.put("idToken", idToken);
    accountData.put("oAuthToken", oAuthToken);
    accountData.put("googleLoginPlugin", googleLoginPlugin);

Can you please tell me what parameters should i change for facebook.

cprakashagr commented 8 years ago

@najeebullahshah Man, I haven't worked with the facebook oAuth API as of now. This link might help you, https://developers.facebook.com/docs/facebook-login/android#get_current.

cprakashagr commented 8 years ago

Kindly be updated about the LinkedIn Login as well.

ocram commented 8 years ago

For Google and LinkedIn, please take a look at @cprakashagr's code here: https://github.com/delight-im/Android-DDP/pull/40

For Facebook and Twitter, someone would have to write something similar that consists of ...

gopinath-langote commented 8 years ago

Hello Everyone, I have implemented loginWithGmail functionality to Meteor DDP for my project. Using server side method. By loginWithUsername or registerWithUser name we should have password. but for loginWithGmail we don't need password. So I published method called createUser on server side and allows client to call it [ Specifically mobile client android / IOS ].this method takes userJson object containing user details like username,email,id [by google ],gender etc, which we will get by Google Auth in mobile app.And this method return me the document of created user. For sign in with google , i have used GoogleAuth by goole. One can ping for more details and implementation stuff. If one could allow me to insert code in existing library of Meteor class . We can go ahead.

ocram commented 8 years ago

@gopinath-langote Thanks! In what way is your solution for "Gmail" different from @cprakashagr's solution for "Google+" linked in the Extensions.md file in this repository?

ocram commented 8 years ago

Closing, as the Google case has been solved, at least.

For Facebook or Twitter integrations that become available, please open a separate issue in the future :)

Thank you!