CLASS
HaapiUIKitConfigurationBuilder
Contents
- Methods
init(clientId:baseUrl:tokenEndpointUrl:authorizationEndpointUrl:appRedirect:)setAutoPollingDuration(duration:)setPresentationMode(mode:)setAuthenticationSelectionPresentation(presentation:)setShouldAutoHandleFlowErrorFeedback(value:)setShouldConfirmInterruptionFlow(value:)setUseDefaultExternalBrowser(value:)setKeyStoreAlias(alias:)setOauthAuthorizationParamsProvider(provider:)setHttpHeadersProvider(provider:)setIsAutoRedirect(value:)setURLSession(session:)setApplicationBundle(_:)setRiskAssessmentConfiguration(_:)setMinTokenTtl(value:)setRevocationEndpointUrl(endpoint:)setDCRConfiguration(configuration:)setShouldClearExistingDCRClient(value:)setClientAuthenticationMethod(method:)setTokenBoundConfiguration(configuration:)setAttestationConfiguration(configuration:)build()
 
public class HaapiUIKitConfigurationBuilder
A builder-pattern class, designed to build a WidgetConfiguration without the need to provide configuration models from the underlying support frameworks.
Methods
init(clientId:baseUrl:tokenEndpointUrl:authorizationEndpointUrl:appRedirect:)
public init(clientId: String,
            baseUrl: URL,
            tokenEndpointUrl: URL,
            authorizationEndpointUrl: URL,
            appRedirect: String)
Initializes the Builder with the mandatory  parameters.
- Parameters:
- clientId: The client ID to use when interacting with the Curity Identity Server.
 - baseUrl: The base Url of the server.
 - tokenEndpointUrl: The token endpoint.
 - authorizationEndpointUrl: The authorization endpoint.
 - appRedirect: The client redirect Url.
 
 
Parameters
| Name | Description | 
|---|---|
| clientId | The client ID to use when interacting with the Curity Identity Server. | 
| baseUrl | The base Url of the server. | 
| tokenEndpointUrl | The token endpoint. | 
| authorizationEndpointUrl | The authorization endpoint. | 
| appRedirect | The client redirect Url. | 
setAutoPollingDuration(duration:)
public func setAutoPollingDuration(duration: TimeInterval) -> HaapiUIKitConfigurationBuilder
Sets how long automatic polling waits between triggering polling requests to the server. Providing a value > 0 means that HaapiFlow will automatically
handle the polling process, else it will disable automatic polling behaviour. The default value is 3 seconds.
- Parameters:
- duration: A duration before the automatic polling is triggered.
 
 
Parameters
| Name | Description | 
|---|---|
| duration | A duration before the automatic polling is triggered. | 
setPresentationMode(mode:)
public func setPresentationMode(mode: PresentationMode) -> HaapiUIKitConfigurationBuilder
Sets which PresentationMode is used for transition. The default value is PresentationMode.modal.
- Parameters:
- mode: The new mode value.
 
 
Parameters
| Name | Description | 
|---|---|
| mode | The new mode value. | 
setAuthenticationSelectionPresentation(presentation:)
public func setAuthenticationSelectionPresentation(
    presentation: AuthenticatorSelectionPresentation
) -> HaapiUIKitConfigurationBuilder
Sets which AuthenticatorSelectionPresentation is used when AuthenticatorSelectorStep is presented.
The default value is AuthenticatorSelectionPresentation.list.
- Parameters:
- presentation: The new mode value.
 
 
Parameters
| Name | Description | 
|---|---|
| presentation | The new mode value. | 
setShouldAutoHandleFlowErrorFeedback(value:)
public func setShouldAutoHandleFlowErrorFeedback(value: Bool) -> HaapiUIKitConfigurationBuilder
Sets if unexpected and critical errors that prevent the flow from continuing, should display feedback to the user via an AlertDialog.
The default value is true.
- Parameters:
- value: A boolean to instruct if an unexpected or critical errors should display feedback.
 
 
Parameters
| Name | Description | 
|---|---|
| value | A boolean to instruct if an unexpected or critical errors should display feedback. | 
setShouldConfirmInterruptionFlow(value:)
public func setShouldConfirmInterruptionFlow(value: Bool) -> HaapiUIKitConfigurationBuilder
Sets if an alert should ask a confirmation before interrupting the flow when pressing the back button or close button. The default value is true.
- Parameters:
- value: A boolean to instruct if should ask a confirmation.
 
 
Parameters
| Name | Description | 
|---|---|
| value | A boolean to instruct if should ask a confirmation. | 
setUseDefaultExternalBrowser(value:)
public func setUseDefaultExternalBrowser(value: Bool) -> HaapiUIKitConfigurationBuilder
Sets the configuration that instructs if default UIApplication.OpenUrl should be used for external browser interaction during the Haapi Flow.
The default value is false, meaning that by default it uses embeded ASWebAuthenticationSession.
- Parameters:
- value: A bool value.
 
 
Parameters
| Name | Description | 
|---|---|
| value | A bool value. | 
setKeyStoreAlias(alias:)
public func setKeyStoreAlias(alias: String) -> HaapiUIKitConfigurationBuilder
Sets the name (alias) for the key store entry holding the used key pair. This value should be unique as it is being used when performing an Haapi flow.
- Parameters:
- alias: The key store alias.
 
 
Parameters
| Name | Description | 
|---|---|
| alias | The key store alias. | 
setOauthAuthorizationParamsProvider(provider:)
public func setOauthAuthorizationParamsProvider(
    provider: @escaping OAuthAuthorizationParametersProvider
) -> HaapiUIKitConfigurationBuilder
Sets a closure that produces the authorization request parameters that will be used when accessing the authorization endpoint. The default value is nil.
- Parameters:
- provider: A closure that produces an 
OAuthAuthorizationParamsinstance. 
 - provider: A closure that produces an 
 
Parameters
| Name | Description | 
|---|---|
| provider | A closure that produces an OAuthAuthorizationParamsinstance. | 
setHttpHeadersProvider(provider:)
public func setHttpHeadersProvider(provider: @escaping HttpHeadersProvider) -> HaapiUIKitConfigurationBuilder
Sets a function that produces http headers used when an HTTP request is performed. The default value is nil.
- Parameters:
- provider: A closure that produces http headers.
 
 
Parameters
| Name | Description | 
|---|---|
| provider | A closure that produces http headers. | 
setIsAutoRedirect(value:)
public func setIsAutoRedirect(value: Bool) -> HaapiUIKitConfigurationBuilder
Sets the configuration that instructs if redirection steps should be automatically followed during the Haapi Flow.
The default value is true.
- Parameters:
- value: A bool value.
 
 
Parameters
| Name | Description | 
|---|---|
| value | A bool value. | 
setURLSession(session:)
public func setURLSession(session: URLSession) -> HaapiUIKitConfigurationBuilder
Sets the URLSession that is to be used when an HTTP request is performed.
- Parameters:
- session: The session instance.
 
 
Parameters
| Name | Description | 
|---|---|
| session | The session instance. | 
setApplicationBundle(_:)
Sets the application Bundle. The Bundle is required when the client configuration for Haapi integerates the BankID services
which may require the application to provide contextual information for risk assessment purposes.
- Parameter bundle: The application 
Bundle. - Important: Omitting the bundle while using the risk assessment functionaly may lead to undesired behaviour and prevent its correct usage. Server support for the risk assessment functionality integration requires a version of the Curity Identity Server starting from 9.7.0.
 
setRiskAssessmentConfiguration(_:)
public func setRiskAssessmentConfiguration(
    _ configuration: RiskAssessmentConfiguration
) -> HaapiUIKitConfigurationBuilder
Sets the risk assessment configuration.
Use this method to provide device and application context for risk assessment purposes. The configuration will be stored and used in subsequent token management operations.
- Parameter configuration: The 
RiskAssessmentConfigurationcontaining device and app information. - Returns: The current 
HaapiUIKitConfigurationBuilderinstance, allowing for method chaining. - Note: Server support for the risk assessment functionality integration requires a version of the Curity Identity Server starting from 9.7.0.
 - Important: Omitting the bundle while using the risk assessment functionaly may lead to undesired behaviour and prevent its correct usage.
 
Parameters
| Name | Description | 
|---|---|
| configuration | The RiskAssessmentConfiguration containing device and app information. | 
setMinTokenTtl(value:)
public func setMinTokenTtl(value: TimeInterval) -> HaapiUIKitConfigurationBuilder
Sets the minimum time to live that an access token must have to be used in a request, otherwise a new access token is retrieved and used. The default value is 10 seconds.
- Parameters:
- value: The minimum time to live of the token.
 
 
Parameters
| Name | Description | 
|---|---|
| value | The minimum time to live of the token. | 
setRevocationEndpointUrl(endpoint:)
public func setRevocationEndpointUrl(endpoint: URL) -> HaapiUIKitConfigurationBuilder
Sets the revocation endpoint Url. The default value is null.
- Parameters:
- endpoint: The URL for the revocation endpoint.
 
 
Parameters
| Name | Description | 
|---|---|
| endpoint | The URL for the revocation endpoint. | 
setDCRConfiguration(configuration:)
public func setDCRConfiguration(configuration: DCRConfiguration) -> HaapiUIKitConfigurationBuilder
Sets a DCR configuration that is used as a fallback when Device Attestation is not supported on the device. The default value is nil.
- Parameter configuration: The 
DCRConfigurationinstance to use when fallback is required. 
Parameters
| Name | Description | 
|---|---|
| configuration | The DCRConfiguration instance to use when fallback is required. | 
setShouldClearExistingDCRClient(value:)
public func setShouldClearExistingDCRClient(value: Bool) -> HaapiUIKitConfigurationBuilder
Sets the configuration that instructs the framework to clear the existing Dcr Client.
setClientAuthenticationMethod(method:)
public func setClientAuthenticationMethod(method: ClientAuthenticationMethod) -> HaapiUIKitConfigurationBuilder
Sets a client authentication method configuration as defined in the Curity identity Server for a client. The default value is ClientAuthenticationMethodNone.
- Parameter method: The configuration instance for 
ClientAuthenticationMethod. 
Parameters
| Name | Description | 
|---|---|
| method | The configuration instance for ClientAuthenticationMethod. | 
setTokenBoundConfiguration(configuration:)
public func setTokenBoundConfiguration(configuration: TokenBoundConfiguration) -> HaapiUIKitConfigurationBuilder
Sets the Token Endpoint Dpop binding mechanism behaviour for the client configuration. The default value is UnboundedTokenConfiguration.
- Parameter configuration: The configuration instance for 
TokenBoundConfiguration. 
Parameters
| Name | Description | 
|---|---|
| configuration | The configuration instance for TokenBoundConfiguration. | 
setAttestationConfiguration(configuration:)
public func setAttestationConfiguration(configuration: AttestationConfiguration) -> HaapiUIKitConfigurationBuilder
Sets the DeviceCheck attestation mechanism configuration settings (applicable only to physical devices).
- Parameter configuration: The configuration instance for 
AttestationConfiguration. 
Parameters
| Name | Description | 
|---|---|
| configuration | The configuration instance for AttestationConfiguration. | 
build()
public func build() -> HaapiUIKitConfiguration
Builds the Haapi UIKit framework configuration.
- Returns: An instance of 
HaapiUIKitConfiguration