WLAuthorizationManager Class Reference
Inherits from | NSObject |
Declared in | WLAuthorizationManager.h |
Tasks
-
authorizationServerURL
property -
timeOut
property -
+ sharedInstance
-
– obtainAccessTokenForScope:withCompletionHandler:
-
– isGatewayResponse:
-
– logout:withCompletionHandler:
-
– login:withCredentials:withCompletionHandler:
-
– isAuthorizationRequiredForResponse:
-
– isAuthorizationRequiredForResponseWithStatus:headers:
-
– resourceScopeFromResponse:
-
– clearAccessToken:
-
– setAuthorizationServerURL:
-
– setLoginTimeout:
-
– resourceScopeFromResponseHeaders:
Properties
Instance Methods
clearAccessToken:
Clears an invalid Access token from the WLAuthorizationManager cache
- (void)clearAccessToken:(AccessToken *)accessToken
Parameters
- AccessToken
to remove
Declared In
WLAuthorizationManager.h
isAuthorizationRequiredForResponse:
Checks if the response for a request to a MobileFirst protected resource indicates that authorization is required.
- (BOOL)isAuthorizationRequiredForResponse:(NSURLResponse *)response
Parameters
- NSURLResponse
response.
Return Value
true if MobileFirst authorization is required, false otherwise.
Declared In
WLAuthorizationManager.h
isAuthorizationRequiredForResponseWithStatus:headers:
Checks whether the response is a MobileFirst OAuth error.
- (BOOL)isAuthorizationRequiredForResponseWithStatus:(NSInteger)status headers:(NSDictionary *)headers
Parameters
- status
HTTP status
- headers
NSDictionary
of response headers
Return Value
true if the response is a MobileFirst OAuth error, or false otherwise.
Declared In
WLAuthorizationManager.h
isGatewayResponse:
Check if the WLResponse contains a Gateway Challenge
- (BOOL)isGatewayResponse:(WLResponse *)wlResponse
Parameters
- wlResponse
The incoming response
Declared In
WLAuthorizationManager.h
login:withCredentials:withCompletionHandler:
Login to the specified security check.
- (void)login:(NSString *)securityCheck withCredentials:(NSDictionary *)credentials withCompletionHandler:(void ( ^ ) ( NSError *error ))completionHandler
Parameters
- completionHandler
Completion handler containing the error information in case of failure.
- NSString
- The security check to log in to.
- NSDictionary
- The credentials to use for login to the security check.
Declared In
WLAuthorizationManager.h
logout:withCompletionHandler:
Logout from the specified security check.
- (void)logout:(NSString *)securityCheck withCompletionHandler:(void ( ^ ) ( NSError *error ))completionHandler
Parameters
- completionHandler
Completion handler with response containing error information in case of failure.
- NSString
- The security check to log out from.
Declared In
WLAuthorizationManager.h
obtainAccessTokenForScope:withCompletionHandler:
Obtains an access token for the specified MobileFirst protected resource scope.
- (void)obtainAccessTokenForScope:(NSString *)scope withCompletionHandler:(void ( ^ ) ( AccessToken *accessToken , NSError *error ))completionHandler
Parameters
- scope
The protected resource scope. ToDo - document the behaviour in case of nil or empty scope
- completionHandler
Completion handler with response containing the access token, or error information in case of failure.
Declared In
WLAuthorizationManager.h
resourceScopeFromResponse:
Returns the resource scope from a response for a request to a MobileFirst protected resource.
- (NSString *)resourceScopeFromResponse:(NSURLResponse *)response
Parameters
- response
Response returned for the request to a protected resource.
Return Value
Scope that is returned in the WWW-Authenticate
header
Declared In
WLAuthorizationManager.h
resourceScopeFromResponseHeaders:
Returns the resource scope from a response for a request to a MobileFirst protected resource.
- (NSString *)resourceScopeFromResponseHeaders:(NSDictionary *)headers
Parameters
- NSDictionary
Response headers returned for the request to a protected resource.
Return Value
Scope that is returned in the WWW-Authenticate
header
Declared In
WLAuthorizationManager.h