• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 10.2.0.83
GDUtility.h
Go to the documentation of this file.
1 /*
2  * (c) 2019 BlackBerry Limited. All rights reserved.
3  *
4  */
5 
6 #pragma once
7 
8 #import <Foundation/Foundation.h>
9 
21 NS_ASSUME_NONNULL_BEGIN
22 
23 typedef NS_ENUM(NSInteger, BBDJWTStatusCode) {
27 
31 
35 
39 
43 
47 
52 };
53 
65 typedef void (^BBDJWTCompletion)(NSString* JWT, BBDJWTStatusCode status, int error);
82 
97 - (void)onGDAuthTokenSuccess:(NSString*)gdAuthToken;
98 
122 - (void)onGDAuthTokenFailure:(NSError*) authTokenError;
123 
124 @end
125 
243 @interface GDUtility : NSObject
244 
278 - (void)getGDAuthToken: (NSString*) challenge serverName:(nullable NSString*) serverName;
279 
292 - (NSString *)getDynamicsSharedUserIDWithError:(NSError **)error;
293 
322 - (BOOL) getEIDToken:(NSString *) clientID withScope:(NSString*) scope withResourceServer:(NSString*) resourceServer withRefresh:(BOOL) refresh withCompletion:(BBDJWTCompletion) callback withError:(NSError**) error;
323 
334 @property (nullable, weak, getter = getGDAuthDelegate, setter = setGDAuthDelegate:) id<GDAuthTokenDelegate> gdAuthDelegate;
335 
336 
337 @end
338 
350 extern NSString* const GDAuthTokenDomain;
351 
352 
353 typedef NS_ENUM(NSInteger, GDAuthTokenError)
354 {
359 
366 
367 };
368 
372 NS_ASSUME_NONNULL_END
BBDJWTStatusCode
BBDJWTStatusCode
Status codes from BlackBerry Enterprise Identity JWT request.
Definition: GDUtility.h:23
GDUtility
BlackBerry Dynamics utility for managing authentication tokens and identity.
Definition: GDUtility.h:243
BBDJWTAuthFailure
@ BBDJWTAuthFailure
Client is not authorised to make this request.
Definition: GDUtility.h:46
BBDJWTMTDNotEnabled
@ BBDJWTMTDNotEnabled
MTD is not enabled (only for MTD related requests)
Definition: GDUtility.h:34
BBDJWTPendingActivation
@ BBDJWTPendingActivation
Server has not yet updated to accept a recently enrolled authorisation.
Definition: GDUtility.h:51
BBDJWTServerUnreachable
@ BBDJWTServerUnreachable
Server not reachable or cannot establish a connection.
Definition: GDUtility.h:42
BBDJWTStatusUnknownError
@ BBDJWTStatusUnknownError
A general error occurred not covered by other status codes.
Definition: GDUtility.h:30
BBDJWTStatusOK
@ BBDJWTStatusOK
Request successful.
Definition: GDUtility.h:26
GDAuthTokenDomain
NSString *const GDAuthTokenDomain
Error domain for the BlackBerry Dynamics authentication token mechanism.
BBDJWTCompletion
void(^ BBDJWTCompletion)(NSString *JWT, BBDJWTStatusCode status, int error)
Completion Block definition for JWT retrieval.
Definition: GDUtility.h:65
BBDJWTServerError
@ BBDJWTServerError
Server responded with an error.
Definition: GDUtility.h:38
GDUtility::gdAuthDelegate
id< GDAuthTokenDelegate > gdAuthDelegate
Delegated event-handling.
Definition: GDUtility.h:334
GDAuthTokenErrRetry
@ GDAuthTokenErrRetry
An error occurred during token generation or communication.
Definition: GDUtility.h:365
GDAuthTokenErrNotSupported
@ GDAuthTokenErrNotSupported
The BlackBerry Dynamics server software installed at the enterprise doesn't support the authenticatio...
Definition: GDUtility.h:358
GDAuthTokenError
GDAuthTokenError
Definition: GDUtility.h:353
GDAuthTokenDelegate-p
Delegate for handling the results of BlackBerry Dynamics authentication token requests.
Definition: GDUtility.h:81