CLASS
HaapiUIKitConfigurationBuilder
Contents
- Methods
init(clientId:baseUrl:tokenEndpointUrl:authorizationEndpointUrl:appRedirect:)setAutoPollingDuration(duration:)setPresentationMode(mode:)setAuthenticationSelectionPresentation(presentation:)setShouldAutoHandleFlowErrorFeedback(value:)setShouldConfirmInterruptionFlow(value:)setKeyStoreAlias(alias:)setOauthAuthorizationParamsProvider(provider:)setHttpHeadersProvider(provider:)setIsAutoRedirect(value:)setURLSession(session:)setMinTokenTtl(value:)setRevocationEndpointUrl(endpoint:)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. | 
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. | 
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. | 
build()
public func build() -> HaapiUIKitConfiguration
Builds the Haapi UIKit framework configuration.
- Returns: An instance of 
HaapiUIKitConfiguration