WLAuthorizationManager Class Reference
| Inherits from | NSObject |
| Declared in | WLAuthorizationManager.h |
Tasks
-
authorizationServerURLproperty -
+ sharedInstance -
– obtainAccessTokenForScope:withCompletionHandler: -
– isGatewayResponse: -
– logout:withCompletionHandler: -
– login:withCredentials:withCompletionHandler: -
– isAuthorizationRequiredForResponse: -
– isAuthorizationRequiredForResponseWithStatus:headers: -
– resourceScopeFromResponse: -
– clearAccessToken: -
– setAuthorizationServerURL: -
– resourceScopeFromResponseHeaders:
Instance Methods
clearAccessToken:
Clears an invalid Access token from the WLAuthorizationManager cache
- (void)clearAccessToken:(AccessToken *)accessTokenParameters
- AccessToken
to remove
Declared In
WLAuthorizationManager.hisAuthorizationRequiredForResponse:
Checks if the response for a request to a MobileFirst protected resource indicates that authorization is required.
- (BOOL)isAuthorizationRequiredForResponse:(NSURLResponse *)responseParameters
- NSURLResponse
response.
Return Value
true if MobileFirst authorization is required, false otherwise.
Declared In
WLAuthorizationManager.hisAuthorizationRequiredForResponseWithStatus:headers:
Checks whether the response is a MobileFirst OAuth error.
- (BOOL)isAuthorizationRequiredForResponseWithStatus:(NSInteger)status headers:(NSDictionary *)headersParameters
- status
HTTP status
- headers
NSDictionaryof response headers
Return Value
true if the response is a MobileFirst OAuth error, or false otherwise.
Declared In
WLAuthorizationManager.hisGatewayResponse:
Check if the WLResponse contains a Gateway Challenge
- (BOOL)isGatewayResponse:(WLResponse *)wlResponseParameters
- wlResponse
The incoming response
Declared In
WLAuthorizationManager.hlogin:withCredentials:withCompletionHandler:
Login to the specified security check.
- (void)login:(NSString *)securityCheck withCredentials:(NSDictionary *)credentials withCompletionHandler:(void ( ^ ) ( NSError *error ))completionHandlerParameters
- 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.hlogout:withCompletionHandler:
Logout from the specified security check.
- (void)logout:(NSString *)securityCheck withCompletionHandler:(void ( ^ ) ( NSError *error ))completionHandlerParameters
- completionHandler
Completion handler with response containing error information in case of failure.
- NSString
- The security check to log out from.
Declared In
WLAuthorizationManager.hobtainAccessTokenForScope:withCompletionHandler:
Obtains an access token for the specified MobileFirst protected resource scope.
- (void)obtainAccessTokenForScope:(NSString *)scope withCompletionHandler:(void ( ^ ) ( AccessToken *accessToken , NSError *error ))completionHandlerParameters
- 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.hresourceScopeFromResponse:
Returns the resource scope from a response for a request to a MobileFirst protected resource.
- (NSString *)resourceScopeFromResponse:(NSURLResponse *)responseParameters
- response
Response returned for the request to a protected resource.
Return Value
Scope that is returned in the WWW-Authenticate header
Declared In
WLAuthorizationManager.hresourceScopeFromResponseHeaders:
Returns the resource scope from a response for a request to a MobileFirst protected resource.
- (NSString *)resourceScopeFromResponseHeaders:(NSDictionary *)headersParameters
- 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