Configuration Model

To establish communication with the Token Server, the iOS SDK has to be provided with a correct configuration model. This can be done using the SDK Configurator. This tool will automatically set all required values and ensure those are aligned with configuration on the token server. The process is explained in our developer quickstart.

What the SDK configurator does for you

In order to configure the SDK, some properties like the following must be configured:

  • ONGAppIdentifier - Application identifier used in dynamic client registration.
  • ONGAppPlatform - Application platform used in dynamic client registration.
  • ONGAppVersion - Application version used in dynamic client registration.
  • ONGAppBaseURL - Base url of the OAuth Server installation.
  • ONGResourceBaseURL - Base url of the resource server.
  • ONGRedirectURL - Redirect url used to complete registration process.

Manual configuration

To configure Onegini SDK manually its required to create an instance of ONGConfigModel. Then this object needs to be passed to ONGClientBuilder when creating ONGClient instance. Example:

ONGConfigModel *configModel = [[ONGConfigModel alloc] initWithDictionary:@{
    ONGAppIdentifier : @"appIdentifier"
    ONGAppPlatform : @"ios"
    ONGAppVersion : @"1.0.0"
    ONGAppBaseURL : @"https://token-server.com"
    ONGResourceBaseURL : @"https://resource-server.com"
    ONGRedirectURL : @"appscheme://loginsuccess"
}];
ONGClientBuilder *clientBuilder = [[ONGClientBuilder alloc] init];
self.oneginiClient = [[[clientBuilder setConfigModel:configModel] setX509PEMCertificates:@[certificate]] build];

ONGConfigModel can also be instantiated from a .plist file using - (id)initWithContentsOfFile:(NSString *)path; initializer:

Configuration plist

ONGConfigModel *configModel = [[ONGConfigModel alloc] initWithContentsOfFile:configurationFilePath];
ONGClientBuilder *clientBuilder = [[ONGClientBuilder alloc] init];
self.oneginiClient = [[[clientBuilder setConfigModel:configModel] setX509PEMCertificates:@[certificate]] build];