Conforms to NSObject
Declared in RKOAuthClient.h

Overview

The delegate of an RKOAuthClient object must adopt the RKOAuthClientDelegate protocol. The protocol defines all methods relating to obtaining an accessToken and handling any errors along the way. It optionally provides callbacks for many different OAuth2 exceptions that may occur during the authorization code flow.

Tasks

Successful responses

Handling errors

Instance Methods

OAuthClient:didAcquireAccessToken:

Sent when a new access token has been acquired

- (void)OAuthClient:(RKOAuthClient *)client didAcquireAccessToken:(NSString *)token

Parameters

client

A reference to the RKOAuthClient that triggered the callback

token

A string of the access token acquired from the authentication server.

Declared In

RKOAuthClient.h

OAuthClient:didFailLoadingRequest:withError:

Sent to the delegate when an authorization code flow request failed due to a loading error somewhere within the RKRequest call

- (void)OAuthClient:(RKOAuthClient *)client didFailLoadingRequest:(RKRequest *)request withError:(NSError *)error

Parameters

client

A reference to the RKOAuthClient that triggered the callback

request

A reference to the RKRequest that failed

error

An NSError object containing the RKOAuthClientError that triggered the callback

Declared In

RKOAuthClient.h

OAuthClient:didFailWithError:

Sent to the delegate when the OAuth client encounters any error.

- (void)OAuthClient:(RKOAuthClient *)client didFailWithError:(NSError *)error

Parameters

client

A reference to the RKOAuthClient that triggered the callback

error

An NSError object containing the RKOAuthClientError that triggered the callback

Declared In

RKOAuthClient.h

OAuthClient:didFailWithInvalidClientError:

Sent when an error is encountered with the OAuth client such as an unknown client, there is no client authentication included, or an unsupported authentication method was used.

- (void)OAuthClient:(RKOAuthClient *)client didFailWithInvalidClientError:(NSError *)error

Parameters

client

A reference to the RKOAuthClient that triggered the callback

error

An NSError object containing the RKOAuthClientError that triggered the callback

Declared In

RKOAuthClient.h

OAuthClient:didFailWithInvalidGrantError:

Sent when an access token request has failed due an invalid authorization code

- (void)OAuthClient:(RKOAuthClient *)client didFailWithInvalidGrantError:(NSError *)error

Parameters

client

A reference to the RKOAuthClient that triggered the callback

error

An NSError object containing the RKOAuthClientError that triggered the callback

Declared In

RKOAuthClient.h

OAuthClient:didFailWithInvalidRequestError:

Sent when the request sent to the authentication server is invalid

- (void)OAuthClient:(RKOAuthClient *)client didFailWithInvalidRequestError:(NSError *)error

Parameters

client

A reference to the RKOAuthClient that triggered the callback

error

An NSError object containing the RKOAuthClientError that triggered the callback

Declared In

RKOAuthClient.h

OAuthClient:didFailWithInvalidScopeError:

Sent when the requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner.

- (void)OAuthClient:(RKOAuthClient *)client didFailWithInvalidScopeError:(NSError *)error

Parameters

client

A reference to the RKOAuthClient that triggered the callback

error

An NSError object containing the RKOAuthClientError that triggered the callback

Declared In

RKOAuthClient.h

OAuthClient:didFailWithUnauthorizedClientError:

Sent when the client isn’t authorized to perform the requested action

- (void)OAuthClient:(RKOAuthClient *)client didFailWithUnauthorizedClientError:(NSError *)error

Parameters

client

A reference to the RKOAuthClient that triggered the callback

error

An NSError object containing the RKOAuthClientError that triggered the callback

Declared In

RKOAuthClient.h

OAuthClient:didFailWithUnsupportedGrantTypeError:

Sent when the grant type specified isn’t supported by the authentication server

- (void)OAuthClient:(RKOAuthClient *)client didFailWithUnsupportedGrantTypeError:(NSError *)error

Parameters

client

A reference to the RKOAuthClient that triggered the callback

error

An NSError object containing the RKOAuthClientError that triggered the callback

Declared In

RKOAuthClient.h