I am using Firebase in my OS X application. I am trying to add Google Authentication. This is an example for iOS.
Question is: How to obtain Google OAuth access token in OS X application?
I am using Firebase in my OS X application. I am trying to add Google Authentication. This is an example for iOS.
Question is: How to obtain Google OAuth access token in OS X application?
UPDATED
Updated code for recent versions of Firebase. Signing in with Google (using OAuth) to authenticate with Firebase.
Firebase auth can be integrated with Google sign in on OS X the following way using the
GTMOAuth2
pod.A couple of things to notice, as brainless mentioned above, you have to create an OAuth Api key using the
other
option in the credentials manager. You have to remember to white list your clientID in your firebase project.It is possible to obtain Google OAuth 2 token in Objective-C with. GTMOAuth2. Using cocoapods:
GTMOAuth2 library needs client id with application type
other
. It is possible to create one in Google Developer Console:This a code sample describing how to work with this lib:
It will create pop-up window with Google authorization page inside on a first launch and use "token" stored in keychain for subsequent runs.
Pros
This authorizer can be used with almost every Google Service.
Cons
Looks like it can not be easily integrated with Firebase.