iOS
Signicat offers a mobile SDK to easily connect iOS devices to the Signicat Identity Broker. The following page will describe how to integrate the iOS SDK in your application.

Requirements

The requirements for the iOS SDK are:
  • minimum iOS version: 11
  • The target phone's default browser must support cookies, otherwise a browser that supports cookies must be set as default

Quick Start

To start using the iOS SDK:
  • include the "ios-sdk-${version}" library in your project
  • set up universal links by following the next section
The iOS SDK uses universal links as a mechanism for connecting to the broker. For this reason, an universal link configuration needs to be set up on your tenant. This can be easily configured from the UI by filling in the iOS App Id under your service provider configuration.
Once the configuration is done, you can view the result at:
https://YOUR_TENANT_DOMAIN/apple-app-site-association
This will take care of the web server configuration. Now in order for your app to work you will need to configure it to handle these URLs.
First step is to add the tenant domain to your associated domains. Afterwards you will need to configure your app delegate to handle URLs and to call
1
ConnectisSDK.continueLogin(userActivity: userActivity)
Copied!
Some URL filtering is recommended to make sure that the SDK will receive only the desired URLs, otherwise it will fail.
Please keep in mind that due to the internal working of iOS redirecting from the browser inside the same domain does not work, so for the Web Login flow a subdomain or different domain is required to host the return universal link as it can be seen in the demo application.

API

The iOS SDK offers 3 basic methods that can be called from the base class: "ConnectisSDK".

Login

1
func logIn(sdkConfiguration: ConnectisSDKConfiguration,
2
caller: UIViewController,
3
delegate: AuthenticationResponseDelegate,
4
allowDeviceAuthentication: Bool = false,
5
errorResponseDelegate: ErrorResponseDelegate? = nil
6
)
Copied!
Where ConnectisSDKConfiguration is a basic data class:
1
public struct ConnectisSDKConfiguration {
2
public var issuer: String
3
public var clientID: String
4
public var redirectURI: String
5
public var scopes: String?
6
public var brokerAppAcs: String?
7
public var brokerDigidAppAcs: String?
8
public var loginFlow: LoginFlow
9
10
public init(issuer: String, clientID: String, redirectURI: String,
11
scopes: String?, brokerAppAcs: String? = nil,
12
brokerDigidAppAcs: String? = nil ,loginFlow: LoginFlow = LoginFlow.WEB) {
13
self.issuer = issuer
14
self.clientID = clientID
15
self.redirectURI = redirectURI
16
self.scopes = scopes
17
self.brokerAppAcs = brokerAppAcs
18
self.brokerDigidAppAcs = brokerDigidAppAcs
19
self.loginFlow = loginFlow
20
}
21
22
}
Copied!
and AuthenticationResponseDelegate is a protocol where you can handle the response:
1
public protocol AuthenticationResponseDelegate: class {
2
func handleResponse(authenticationResponse: AuthenticationResponse)
3
func onCancel()
4
}
Copied!
the AuthenticationResponse is the class you will receive after a login was made in the CIB.
1
public struct AuthenticationResponse {
2
public var isSuccess: Bool
3
public var error: Error?
4
public var nameIdentifier: String?
5
public var attributes: [Attribute]?
6
}
Copied!
Properties definition:
  • issuer - the endpoint of the CIB that you want to connect to. Given by Connectis Technical Support.
  • clientId - the client-id that you provided to Connectis Technical Support.
  • redirectUri - must be set to the universal link value
  • scopes - can be set if you want to do idp scoping (bypass the idp selection screen or for app2app)
  • brokerAppAcs - must be set for app2app openid: broker endpoint for processing app2app openid flows
  • brokerDigidAppAcs - must be set for app2app DigID: broker endpoint for processing app2app DigID flow
  • loginFlow - can be set to either WEB or APP_TO_APP, default is WEB
  • caller - The activity context where you call the ConnectisSDK from
  • delegate - your implementation of the AuthenticationResponseDelegate interface
  • errorResponseDelegate - optional implementation for handling errors (if none is provided, exceptions will be logged)
  • allowDeviceAuthentication - true if you wish to enable device authentication in your application, false otherwise

OpenId Access Token

The API provides access to a valid OpenId access token
1
func useAccessToken(caller: UIViewController,
2
delegate: AccessTokenDelegate
3
)
Copied!
where AccessTokenDelegate is a protocol:
1
public protocol AccessTokenDelegate: class {
2
func handleAccessToken(accessToken: Token)
3
func onError(errorMessage: String)
4
}
Copied!
Note: for security reasons, the OpenId Access Token should be treated as a secret in the software.

Device Authentication

The iOS SDK offers the possibility to authenticate the users, once the user logged in at least once, using the mobile phone device authentication supported methods(face unlock, fingerprint, pin code)
To enable the device authentication flow call the following method after the user logged in using the CIB:
1
func enableDeviceAuthentication(delegate: DeviceAuthenticationResponseDelegate)
Copied!
If you wish to disable the device authentication you can call the following function:
1
func disableDeviceAuthentication()
Copied!
Last modified 4mo ago