SFIdentityCoordinator Class Reference

Inherits from NSObject
Declared in SFIdentityCoordinator.h

Overview

The SFIdentityCoordinator class is used to retrieve identity data from the ID endpoint of the Salesforce service. This data will be based on the requesting user, and the OAuth app credentials he/she is using to request this information.

Internal interface for the SFIdentityCoordinator.

Other Methods

– initWithCredentials:

The designated initializer of SFIdentityCoordinator. Creates an instance with the specified OAuth credentials.

- (id)initWithCredentials:(SFOAuthCredentials *)credentials

Parameters

credentials

The OAuth credentials used to query the identity service. At a minimum, the OAuth credentials must specify a value for accessToken and instanceUrl.

Declared In

SFIdentityCoordinator.h

– initiateIdentityDataRetrieval

Begins the identity request. This request is asynchronous. Implement the SFIdentityCoordinatorDelegate protocol to receive events related to the identity response from the service.

- (void)initiateIdentityDataRetrieval

Declared In

SFIdentityCoordinator.h

– cancelRetrieval

Cancels a request in progress.

- (void)cancelRetrieval

Declared In

SFIdentityCoordinator.h

  credentials

The OAuth credentials associated with this instance.

@property (nonatomic, strong, nullable) SFOAuthCredentials *credentials

Declared In

SFIdentityCoordinator.h

  idData

The SFIdentityData that will be populated with the response data from the service.

@property (nonatomic, strong, nullable) SFIdentityData *idData

Declared In

SFIdentityCoordinator.h

  delegate

The SFIdentityCoordinatorDelegate property to set for receiving information about the request. This property must be set prior to initiating an identity request.

@property (nonatomic, weak) id<SFIdentityCoordinatorDelegate> delegate

Declared In

SFIdentityCoordinator.h

  timeout

The amount of time, in seconds, to attempt the request, before it times out. If not set, the default value is represented by the kSFIdentityRequestDefaultTimeoutSeconds property.

@property (nonatomic, assign) NSTimeInterval timeout

Declared In

SFIdentityCoordinator.h

Extension Methods

  retrievingData

Whether or not a request is already in progress.

@property (assign) BOOL retrievingData

Declared In

SFIdentityCoordinator+Internal.h

  session

The NSURLSession associated with the ID request.

@property (nonatomic, strong, nullable) NSURLSession *session

Declared In

SFIdentityCoordinator+Internal.h

  oauthSessionRefresher

The OAuth sesssion refresher to use if the identity request fails with expired credentials.

@property (nonatomic, strong, nullable) SFOAuthSessionRefresher *oauthSessionRefresher

Declared In

SFIdentityCoordinator+Internal.h

  typeToCodeDict

Dictionary mapping error codes to their respective types.

@property (strong, nonatomic, readonly) NSDictionary *typeToCodeDict

Declared In

SFIdentityCoordinator+Internal.h

  authSession

@property (nonatomic, weak, nullable) SFSDKAuthSession *authSession

– initWithAuthSession:

- (id)initWithAuthSession:(SFSDKAuthSession *)authSession

– notifyDelegateOfSuccess

Triggers the success notifictation to the delegate.

- (void)notifyDelegateOfSuccess

Declared In

SFIdentityCoordinator+Internal.h

– notifyDelegateOfFailure:

Triggers the failure notification and error to the delegate.

- (void)notifyDelegateOfFailure:(NSError *)error

Declared In

SFIdentityCoordinator+Internal.h

– sendRequest

Sends the request to the identity service, and processes the response.

- (void)sendRequest

Declared In

SFIdentityCoordinator+Internal.h

– processResponse:

Process a completed response from the service, populating the ID data.

- (void)processResponse:(NSData *)responseData

Declared In

SFIdentityCoordinator+Internal.h

– cleanupData

Cleans up the in-process properties and vars, once a request is completed.

- (void)cleanupData

Declared In

SFIdentityCoordinator+Internal.h

– errorWithType:description:

Creates an NSError instance based on type and description, for notifying the delegate of a failure.

- (NSError *)errorWithType:(NSString *)type description:(NSString *)description

Declared In

SFIdentityCoordinator+Internal.h