CLASS

HaapiUIKitConfigurationBuilder

Contents

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

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

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

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

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

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

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

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

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

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

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

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

Name Description
session The session instance.

setApplicationBundle(_:)

public func setApplicationBundle(_ bundle: Bundle) -> HaapiUIKitConfigurationBuilder

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.

Parameters

Name Description
bundle The application Bundle.

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

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

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.

Parameters

Name Description
configuration The DCRConfiguration instance to use when fallback is required.

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.

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.

Parameters

Name Description
configuration The configuration instance for TokenBoundConfiguration.

build()

public func build() -> HaapiUIKitConfiguration

Builds the Haapi UIKit framework configuration.