OlapicOAuthMethod Class Reference
| Inherits from | NSObject |
| Declared in | OlapicOAuthMethod.h |
Overview
The base interface for the OAuth connections. The subclass should be able to get, validate and manage the tokens
Properties
Instance Methods
canReuseToken
Check if a saved token can be reused. If it returns true, it can be retrieved using getSavedToken
- (BOOL)canReuseTokenReturn Value
If the token can be reused or not
Availability
v1.0
Declared In
OlapicOAuthMethod.hclearCache
Clear any information saved on the app settings
- (void)clearCacheAvailability
v1.0
Declared In
OlapicOAuthMethod.hgetDeviceIdentifier
Get the device identifier saved on the app settings
- (NSString *)getDeviceIdentifierReturn Value
The identifier
Availability
v1.0
Declared In
OlapicOAuthMethod.hgetKeychain
Get the Keychain object to save and read credentials
- (KeychainItemWrapper *)getKeychainReturn Value
The Keychain object
Availability
v1.0
Declared In
OlapicOAuthMethod.hgetOAuthClient
Get the AFNetworking OAuth ‘plugin’ instance
- (OlapicAFOAuth2Client *)getOAuthClientReturn Value
The OAuth client
Availability
v1.0
Declared In
OlapicOAuthMethod.hgetOAuthURL
Get the OAuth server URL
- (NSString *)getOAuthURLReturn Value
The OAuth server URL
Availability
v1.0
Declared In
OlapicOAuthMethod.hgetSavedToken
Retrieve a saved token from the app settings
- (NSString *)getSavedTokenReturn Value
The saved token
Availability
v1.0
Declared In
OlapicOAuthMethod.hgetScopes
Once connected, this method can be used to retrieve the list of scopes associated to the token
- (NSArray *)getScopesReturn Value
The list of scopes
Availability
v1.0
Declared In
OlapicOAuthMethod.hgetSettingsKey
The key used by the class to saved information into the app settings. The subclass should extend this method with its own key.
- (NSString *)getSettingsKeyReturn Value
The key
Availability
v1.0
Declared In
OlapicOAuthMethod.hhasScope:
An easy way to check if the connected token has a specific scope
- (BOOL)hasScope:(NSString *)scopeParameters
- scope
The scope you want to verify
Return Value
Whether the scope is preset or not
Availability
v1.0
Declared In
OlapicOAuthMethod.hrestoreScopes
Restore the saved token scopes into this object
- (void)restoreScopesAvailability
v1.0
Declared In
OlapicOAuthMethod.hsaveCredentials:
Save a set of credentials provided by the AFNetworking ‘plugin’
- (void)saveCredentials:(OlapicAFOAuthCredential *)credentialsParameters
- credentials
The credentials object
Availability
v1.0
Declared In
OlapicOAuthMethod.hsetOAuthURL:
The SDK singleton will use this method to set the OAuth server URL
- (void)setOAuthURL:(NSString *)URLParameters
- URL
The OAuth server URL
Availability
v1.0
Declared In
OlapicOAuthMethod.hsetup
This is the method the subclass will use to create an instance of the AFNetworking ‘plugin’ and do extra setup
- (void)setupAvailability
v1.0
Declared In
OlapicOAuthMethod.hvalidateRequest:onFailure:
This is the method the subclass will use to validate the existence and the expiration date of a token, before doing any request
- (void)validateRequest:(void ( ^ ) ( NSString *token ))success onFailure:(void ( ^ ) ( NSError *error ))failureParameters
- success
The callback method to be called after a valid token is retrieved/created
- failure
The callback method to be called if the client has to connect to the server, and the connection fails
Availability
v1.0
Declared In
OlapicOAuthMethod.h