Instance Method

authorizationResponseHandler(for:)

Handles the callback URL from an ASWebAuthenticationSession and sends a HTTP request to the initialized token endpoint for the tokens.

Declaration

func authorizationResponseHandler(for response: Response) async throws

Parameters

for

The callback URL from a ASWebAuthenticationSession.

Discussion

Tokens are saved to the Keychain instance provided by the initializer. The tokens are saved using the instance’s client id and the string “tokens” separated by a colon as the key. For example: “9d73bfb50b304543b35f41d427e6b76c:tokens”

If an HTTP error occurs, the token request will be retried once.