Gmail API 0Auth 2.0 using OAuth Phonegap SDK - oauth-2.0

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.

Related

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

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.

use titanium appcelerator user as oauth for third party applications

I have a appcelerator titanium app, and I would like to use the same users and password for other apps, not related to appcelerator ACS or titanium, the question is: can I use appcelerator ACS as oauth for other applications?
I'm not familiar with ACS to much but from documentation I can find below:
it is not proffered as the ACS mention in its documentation
Your app must prove that it is allowed to talk to ACS. This keeps your
data secure by preventing anyone from making requests to ACS that
impersonate your app.
but you can create new app with new client-id as in ACS mention that:
You can integrate ACS into your application using the REST API, the
Titanium SDK, or the ACS native iOS and Android SDKs.
http://docs.appcelerator.com/cloud/latest/#!/guide/acs_quickstart
http://docs.appcelerator.com/cloud/latest/#!/guide/acs_authentication

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/

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