OAuth2 Login on Android and iOS - oauth-2.0

I have built a web application that allows users to login with Google and Facebook through OAuth 2.0. I actually used the SimpleAuth project on Google App Engine. In my database I am storing their OAuth ID, which for Google looks like:
https://www.google.com/accounts/o8/id?id=AItOawnrcuEaKdY_EMesk8FdeFNGP-cCKJbmVf0
and for Facebook looks like:
facebook:1494270173
and I am wondering if I can use the same method on an iOS or Android app. I know that I will need a much different implementation but will that ID be constant even if I am using a Facebook or Google login on mobile?

The Google identifier you show is an OpenID2 identifier, not an OAuth 2 one. OpenID2 will not work on iOS nor Android. Not familiar with SimpleAuth, but if you can configure it to use OAuth 2 or OpenID Connect (which is based on OAuth 2, not to be confused with OpenID2), then using the OAuth 2 protocol on iOS or Android will give you the same identifier for the same user.

Related

Nodejs Apple native authentication

i'm a nodejs backend developer and i have an app with nodejs backend and the client side is ios, swift. I need to to do the feature sign in with apple
I figure out there are 2 ways to sign in with apple. One is using restful api, one is sign in with native device.
I know how to do the sign in with apple using restful api, because i worked with passportjs and i did the sign in with fb, twitter before. However i don't understand how the sign in with apple (the native way) work on the nodejs side.
Here is the article: https://auth0.com/docs/connections/apple-siwa/add-siwa-to-native-app
As you are using regular web app (node), you should use web based flow. Native implementation is not applicable in your case. You can enable Sing In with Apple like any other social login in Auth0.
https://auth0.com/docs/connections/apple-siwa/add-siwa-to-web-app

Is it possible to integrate the Facebook login without using the iOS SDK?

Currently i am using the Facebook SDK to implement the Facebook login to our native iOS application. For this i am using the native iOS SDK for Facebook. This application is both for mobile and web, so is it possible to integrate Facebook login without using the SDK from application side. I mean authentication done fully through API and server side.
Please have a suggestion.
I referred to a SO link:
Design for Facebook authentication in an iOS app that also accesses a secured web service
Sure! You can always use their API directly, which essentially is the same as they do with the SDK.
Check out the documentation on the following link.
https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow

Gmail API 0Auth 2.0 using OAuth Phonegap SDK

Has anyone had success in using the Gmail API's authorization in a Phonegap application? I found this (http://phonegap-tips.com/articles/google-api-oauth-with-phonegaps-inappbrowser.html) that describes using the generic Google API OAuth with Phonegap's inappbrowser plugin, but the newly released Gmail API does OAuth authorization differently, and I'm not sure how to get it to work with Phonegap.
Note: It does work when I try a web version of my app, but the button that brings up the authorization screen doesn't do anything in Phonegap..not sure why. I do have the appropriate Android credentials for the app in the Google Developer's Console.
UPDATE: Using OAuth's Phonegap SDK (found after registering your app here: https://oauth.io/), I am able to authenticate a Google Account. However, I am unsure how to then call Gmail API methods or correctly pass whatever authentication tokens from the OAuth SDK to any Gmail API code. Has anyone done this and can share their knowledge?
I found a solution using the OAuthio Phonegap SDK. Then I can call the appropriate HTTPS requests from the Gmail API.
If you want to login your users via Google on iOS and Android, then use this new plugin I just created: https://github.com/EddyVerbruggen/cordova-plugin-googleplus
You will also receive the name and gender etc from the plugin. The plugin will also try SSO with any other Google apps installed on your device by using the Google+ SDK on both platforms.

Post on google plus from ios

My app has a feature to share on google plus.
My app cannot allow users to login using google.
Is it possible to post on google plus without using google plus sign in ?
Google APIs use OAuth 2.0 for both authentication and authorization. You cannot do anything if you are not authorized - it's the matter of security. Here is a great official guide on how to properly login in Google Plus and use different APIs features.
So, you must enable the possibility to login through Google or disable the sharing feature.

Is Google Cross-client Auth possible with iOS, and if so, how?

I'm using oAuth2, and I have a project in my google API console with an iOS client and a Web client registered.
I'd like to auth in from my iOS app, and have my web backend retrieve an access token so it can do the heavy processing work with the Google api.
I've tried following these instructions which are for android: https://developers.google.com/accounts/docs/CrossClientAuth
But I keep getting an invalid scope when I assign the scope as:
oauth2:server:client_id:MY.WEB.CLIENT.ID:api_scope:http://www.google.com/m8/feeds/ https://mail.google.com/ https://www.googleapis.com/auth/plus.login
Anyone successfully implement a similar set up for iOS? If so please explain or share documentation? What libraries or SDKs did you use to get the code from google on the iOS app that the web backend could use to generate a proper access token of it's own?
As of June 18th, the google iOS SDK 1.7.0 supports one-time authorization code which is consistent with the Android feature: https://developers.google.com/+/release-notes/

Resources