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

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/

Related

Can we use same google clientID for iOS and android app?

I am trying to implement google sign in and it worked fine but we have to collaborate with android app too, so we want to use a common client ID for both the apps. Is there any way to achieve this. Why we want to do so because we are sending token to our backend server through an API, then we get user details in the API response. The backend team and the android team are using the same google client ID but I don't have any idea how can I use the same google client ID, if anybody has some idea please help me out.

iOS get contacts from Dynamics CRM API

I am developing an iPhone mobile app. In this I need to implement get contacts from Microsoft Dynamics CRM. I am done with login with Dynamics CRM but I am facing issue in get contacts API.
I am trying to call get contacts API in postman using the way mentioned in documentation but I am getting webpage code in response. If API will start working in postman then I can easily integrate it in my iOS app.
I am referring this link for postman setup: https://learn.microsoft.com/en-us/dynamics365/customer-engagement/developer/webapi/setup-postman-environment
This is screenshot of my postman collection error:https://drive.google.com/open?id=17T93QYKrNkGMmK2QTyaI2kcF1RPrIPs_
This is screenshot of variables I set in postman: https://drive.google.com/open?id=1MFuGci4rJw1Q1RxwNI9fHiBStNy0Z5HI
So can you please help me to execute this get contact API in postman. I am not sure if I am passing wrong value of any parameter or the issue is something different.
seems that the URL parameter is off it should be the Dynamics 365 oganization URL only, like https://orgname.crm.dynamics.com and should be follow by api/data/v9.1/[entity name]
Hope it helps
I guess you are targeting Dynamics CRM online environment but the documentation you are following is for on-premise environment.
Please refer & follow these steps for configuring Postman to target CRM online by generating token using OAuth 2.0 authentication.

Firebase email or Facebook authentication with BlackBerry 10

I want to use Firebase with a BlackBerry 10 Native + Cascades App.
The problem is Firebase has no libraries for BlackBerry 10. I have done some research saying that I can use the REST API, but I cannot find anywhere on how to do email or facebook login via pure REST. Everything involves downloading the Javascript API which I cannot do as QML support with JS is giving me issues.
Does anyone have any ideas or suggestions?
By definition, you can't do authentication via REST. It requires that a user log into a third party service and enter credentials (not possible without a UI). You could create your own UI for authentication and generate your own custom tokens.
Once you have a token, you can pass that to the REST API by adding ?auth= to the URL.

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.

OAuth2 Login on Android and iOS

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.

Resources