• BlackBerry Dynamics
  • Runtime library for iOS applications
  • 12.0.1.79
GDUtility.h
Go to the documentation of this file.
1 /*
2  * Copyright 2023 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);
76 
91 - (void)onGDAuthTokenSuccess:(NSString*)gdAuthToken;
92 
116 - (void)onGDAuthTokenFailure:(NSError*) authTokenError;
117 
118 @end
119 
127 @interface GDUtility : NSObject
128 
162 - (void)getGDAuthToken: (NSString*) challenge serverName:(nullable NSString*) serverName;
163 
176 - (NSString *)getDynamicsSharedUserIDWithError:(NSError **)error;
177 
206 - (BOOL) getEIDToken:(NSString *) clientID withScope:(NSString*) scope withResourceServer:(NSString*) resourceServer withRefresh:(BOOL) refresh withCompletion:(BBDJWTCompletion) callback withError:(NSError**) error;
207 
218 @property (nullable, weak, getter = getGDAuthDelegate, setter = setGDAuthDelegate:) id<GDAuthTokenDelegate> gdAuthDelegate;
219 
220 
221 @end
222 
234 extern NSString* const GDAuthTokenDomain;
235 
236 
237 typedef NS_ENUM(NSInteger, GDAuthTokenError)
238 {
243 
250 
251 };
252 
256 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:127
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:218
GDAuthTokenErrRetry
@ GDAuthTokenErrRetry
An error occurred during token generation or communication.
Definition: GDUtility.h:249
GDAuthTokenErrNotSupported
@ GDAuthTokenErrNotSupported
The BlackBerry Dynamics server software installed at the enterprise doesn't support the authenticatio...
Definition: GDUtility.h:242
GDAuthTokenError
GDAuthTokenError
Definition: GDUtility.h:237
GDAuthTokenDelegate-p
Delegate for handling the results of BlackBerry Dynamics authentication token requests.
Definition: GDUtility.h:75