The newest version of Google Identity Toolkit has been released as Firebase Authentication. It includes upgraded client SDKs, open source UI libraries, session management and integrated email sending service for forgotten password flows.

New projects should use Firebase Authentication. To migrate an existing project from Identity Toolkit to Firebase Authentication, see the migration guide.

GITAuth Class

GITAuth Class Reference

Overview

A singleton class that handles authentication with IdPs and Identity Toolkit server.

Inherits NSObject.

Instance Method Summary

(void) - signInWithSavedAccount
 Signs user in using saved account as hint. More...
 
(void) - signInWithEmail:
 Signs user in using an email address as hint. More...
 
(void) - signInWithProviderID:
 Signs user in with the given identity provider, allowing the login UI to show. More...
 
(void) - signInWithProviderID:interactively:
 Signs user in with the given identity provider with the login UI to show controlled by the flag interactively. More...
 
(void) - signOut
 Signs the user out of cached IdP sessions. More...
 
(void) - verifyPassword:forEmail:invalidCallback:
 Calls Identity Toolkit server to verify user's password. More...
 
(void) - signUpWithEmail:displayName:password:
 Calls Identity Toolkit server to sign up a password user. More...
 
(void) - linkAccountToProviderID:fromProviderID:
 Starts account linking for a federated account. More...
 
(void) - linkAccountWithPassword:invalidCallback:
 Starts account linking for a password account. More...
 

Class Method Summary

(GITAuth *) + sharedInstance
 Returns a shared GITAuth instance. More...
 

Properties

id< GITAuthDelegate > delegate
 Delegate for handling user interface and receiving sign in result. More...
 
NSString * pendingEmail
 Email address to be verified by another IdP in account linking flow. More...
 
NSString * pendingIDToken
 The pending id token to be verified by another IdP in account linking flow. More...
 

Method Detail

+ (GITAuth *) sharedInstance

Returns a shared GITAuth instance.

- (void) signInWithSavedAccount

Signs user in using saved account as hint.

- (void) signInWithEmail: (NSString *)  email

Signs user in using an email address as hint.

Parameters
emailUser's email address, should not be nil.
- (void) signInWithProviderID: (NSString *)  providerID

Signs user in with the given identity provider, allowing the login UI to show.

Parameters
providerIDThe ID of the provider, ex. google.com, facebook.com.
- (void) signInWithProviderID: (NSString *)  providerID
interactively: (BOOL)  interactively 

Signs user in with the given identity provider with the login UI to show controlled by the flag interactively.

Parameters
providerIDThe ID of the provider, ex. google.com, facebook.com.
interactivelyYES if the login UI is allowed to show, NO otherwise.
- (void) signOut

Signs the user out of cached IdP sessions.

Currently only Google and Facebook support cached sessions.

- (void) verifyPassword: (NSString *)  password
forEmail: (NSString *)  email
invalidCallback: (void(^)())  invalidCallback 

Calls Identity Toolkit server to verify user's password.

Parameters
passwordUser's password, should not be nil.
emailUser's email address, should not be nil.
invalidCallbackBlock called when the password is invalid.
- (void) signUpWithEmail: (NSString *)  email
displayName: (NSString *)  displayName
password: (NSString *)  password 

Calls Identity Toolkit server to sign up a password user.

Parameters
emailUser's email address, should not be nil.
displayNameUser's display name, should not be nil.
passwordUser's password, should not be nil.
- (void) linkAccountToProviderID: (NSString *)  toProvider
fromProviderID: (NSString *)  fromProvider 

Starts account linking for a federated account.

The user will be send to system browser to finish the linking process.

Parameters
toProviderThe provider ID of an IdP to be verified.
fromProviderThe provider ID of an IdP the user has previously signed in with.
- (void) linkAccountWithPassword: (NSString *)  password
invalidCallback: (void(^)())  invalidCallback 

Starts account linking for a password account.

The password should have been collected from the user before calling this method.

Parameters
passwordThe password collect from the user, which is to be verified.
invalidCallbackBlock called when the password is invalid.

Property Documentation

- (id<GITAuthDelegate>) delegate
readwritenonatomicweak

Delegate for handling user interface and receiving sign in result.

- (NSString*) pendingEmail
readwritenonatomiccopy

Email address to be verified by another IdP in account linking flow.

- (NSString*) pendingIDToken
readwritenonatomiccopy

The pending id token to be verified by another IdP in account linking flow.