EXTENSION

HaapiManager

public extension HaapiManager

Methods

start(completionHandler:)

func start(completionHandler: @escaping @Sendable HaapiCompletionHandler)

Starts the HAAPI flow by performing an authorization request.

The client_id, response_type and redirect_uri parameters are always added based on the configuration values.

Parameters

Name Description
completionHandler A completion handler that is called when start is complete.

submitForm(_:parameters:completionHandler:)

func submitForm(_ form: FormActionModel,
                parameters: [String: Sendable],
                completionHandler: @escaping @Sendable HaapiCompletionHandler)

Submits a form action to move forward in the HAAPI flow.

The parameters supplied to this method override the field values present in the form. If the parameters don't include a value for a given form field name, the original value in the form is used. Parameters whose key is not included in the form fields names are not included in the request

Parameters

Name Description
form The form action to be submitted
parameters Parameters to be sent in the form. Keys should match the corresponding form field names.
completionHandler A completion handler that is called when submitForm is complete.

followLink(_:completionHandler:)

func followLink(_ link: Link, completionHandler: @escaping HaapiCompletionHandler)

Follows a link to an alternative HAAPI flow.

Links are always followed using a GET request.