Name: Lock-Google.iOS
Owner: Auth0
Description: Lock for iOS add-on to use Google SignIn iOS SDK
Created: 2015-05-18 23:25:03.0
Updated: 2017-01-17 16:38:28.0
Pushed: 2017-08-11 14:42:15.0
Homepage: https://auth0.com/lock
Size: 80
Language: Objective-C
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Auth0 is an authentication broker that supports social identity providers as well as enterprise identity providers such as Active Directory, LDAP, Google Apps and Salesforce.
Lock-Google helps you integrate native login with Google iOS SDK and Lock
This package relies on a token endpoint that is now considered deprecated. If your Auth0 client was created after Jun 8th 2017 you won't be able to use this package. This repository is left for reference purposes.
We recommend using browser-based flows to authenticate users. You can do that using the auth0.swift package, as explained in this document.
iOS 7+
The Lock-Google is available through CocoaPods. To install it, simply add the following line to your Podfile:
"Lock-Google", "~> 3.0"
If you are using CocoaPods with the uses_frameworks!
flag in your Podfile
, adding Lock-Google might make CocoaPods fail because Google SignIn library is distributed as a static lib. A workaround for this case is to add the following files to your project:
And Google SignIn library to your project or to your Podfile
like this:
'Google/SignIn', '~> 3.0'
In order to use Google APIs you'll need to register your iOS application in Google Developer Console and get your clientId.
We recommend follwing this wizard instead and download the file GoogleServices-Info.plist
that is generated at the end.
Add that file to your application's target and the last step is to register two custom URL for your application.
The first URL should have a scheme equal to your application Bundle Identifier, the other one should be your Google clientId reversed, so if your clientID is CLIENTID.apps.googleusercontent.com
the scheme will be com.googleusercontent.apps.CLIENTID
This last value can be found in
GoogleServices-Info.plist
under the keyREVERSED_CLIENT_ID
For more information please check Google's documentation
If you also have a Web Application, and a Google clientID & secret for it configured in Auth0, you need to whitelist the Google clientID of your mobile application in your Auth0 connection. With your Mobile clientID from Google, go to Social Connections, select Google and add the clientID to the field named Allowed Mobile Client IDs
Just create a new instance of A0GoogleAuthenticator
ogleAuthenticator *google = [A0GoogleAuthenticator newAuthenticator];
wift
google = A0GoogleAuthenticator.newAuthenticator()
and register it with your instance of A0Lock
ck *lock = //Get your A0Lock instance
k registerAuthenticators:@[google]];
wift
lock:A0Lock = //Get your A0Lock instance
.registerAuthenticators([google])
A good place to create and register
A0GoogleAuthenticator
is theAppDelegate
.
ogleAuthenticator *google = [A0GoogleAuthenticator newAuthenticatorWithScopes:@[@"scope1", @"scope2"]];
wift
google = A0GoogleAuthenticator.newAuthenticatorWithScopes(["scope1", "scope2"])
ogleAuthenticator *google = [A0GoogleAuthenticator newAuthenticatorForConnectionName:@"my-google-connection"];
wift
google = A0GoogleAuthenticator.newAuthenticatorForConnectionName("my-google-connection")
Please check CocoaDocs for more information about LockGoogle API.
If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
Auth0 helps you to:
Lock-Google is available under the MIT license. See the LICENSE file for more info.