GIDAuthentication Class

GIDAuthentication Class Reference

Overview

This class represents the OAuth 2.0 entities needed for sign-in.

Inherits NSObject. Implements <NSCoding>.

Instance Method Summary

(id
< GTMFetcherAuthorizationProtocol >) 
- fetcherAuthorizer
 Gets a new authorizer for GTLService, GTMSessionFetcher, or GTMHTTPFetcher. More...
 
(void) - getTokensWithHandler:
 Get a valid access token and a valid ID token, refreshing them first if they have expired or are about to expire. More...
 
(void) - refreshTokensWithHandler:
 Refreshes the access token and the ID token using the refresh token. More...
 
(void) - getAccessTokenWithHandler:
 Gets the access token, which may be a new one from the refresh token if the original has already expired or is about to expire. More...
 
(void) - refreshAccessTokenWithHandler:
 Refreshes the access token with the refresh token. More...
 

Property Summary

NSString * clientID
 The client ID associated with the authentication. More...
 
NSString * accessToken
 The OAuth2 access token to access Google services. More...
 
NSDate * accessTokenExpirationDate
 The estimated expiration date of the access token. More...
 
NSString * refreshToken
 The OAuth2 refresh token to exchange for new access tokens. More...
 
NSString * idToken
 An OpenID Connect ID token that identifies the user. More...
 
NSDate * idTokenExpirationDate
 The estimated expiration date of the ID token. More...
 

Related Function Summary

(Note that these are not member functions.)

typedef void(^ GIDAuthenticationHandler )(GIDAuthentication *authentication, NSError *error)
 
typedef void(^ GIDAccessTokenHandler )(NSString *accessToken, NSError *error)
 

Method Detail

- (id<GTMFetcherAuthorizationProtocol>) fetcherAuthorizer

Gets a new authorizer for GTLService, GTMSessionFetcher, or GTMHTTPFetcher.

- (void) getTokensWithHandler: (GIDAuthenticationHandler handler

Get a valid access token and a valid ID token, refreshing them first if they have expired or are about to expire.

- (void) refreshTokensWithHandler: (GIDAuthenticationHandler handler

Refreshes the access token and the ID token using the refresh token.

- (void) getAccessTokenWithHandler: ("Use <code>getTokensWithHandler:</code> instead.")  DEPRECATED_MSG_ATTRIBUTE

Gets the access token, which may be a new one from the refresh token if the original has already expired or is about to expire.

Deprecated: use getTokensWithHandler: to get access tokens instead.

- (void) refreshAccessTokenWithHandler: ("Use <code>refreshTokensWithHandler:</code> instead.")  DEPRECATED_MSG_ATTRIBUTE

Refreshes the access token with the refresh token.

Deprecated: Use refreshTokensWithHandler: to refresh access tokens instead.

Related Functions Detail

- (typedef void(^ GIDAuthenticationHandler)(GIDAuthentication *authentication, NSError *error))
related

The callback block that takes a GIDAuthentication, or an error if attempt to refresh was unsuccessful.

- (typedef void(^ GIDAccessTokenHandler)(NSString *accessToken, NSError *error))
related

The callback block that takes an access token, or an error if attempt to refresh was unsuccessful.

Property Detail

- (NSString*) clientID
readnonatomicassign

The client ID associated with the authentication.

- (NSString*) accessToken
readnonatomicassign

The OAuth2 access token to access Google services.

- (NSDate*) accessTokenExpirationDate
readnonatomicassign

The estimated expiration date of the access token.

- (NSString*) refreshToken
readnonatomicassign

The OAuth2 refresh token to exchange for new access tokens.

- (NSString*) idToken
readnonatomicassign

An OpenID Connect ID token that identifies the user.

Send this token to your server to authenticate the user there. For more information on this topic, see https://developers.google.com/identity/sign-in/ios/backend-auth

- (NSDate*) idTokenExpirationDate
readnonatomicassign

The estimated expiration date of the ID token.