EXTENSION
OAuthTokenManager
@objc public extension OAuthTokenManager
Methods
fetchAccessToken(with:dpop:additionalParameters:completionHandler:)
Fetches an access token using an authorization code grant.
If it succeeds then a SuccessfulTokenResponse
with the access token is returned.
If it fails either a ErrorTokenResponse
with the error reason is returned or the result has an Error
.
- Parameters:
- authorizationCode: The authorization code.
- dpop: The Dpop that was used during the Haapi flow. When it is required, this value has to be used via HaapiManager.dpop.
- additionalParameters: The additional parameters for the request body. The default value is nil.
- completionHandler: A completion handler that is called when
fetchAccessToken
is complete.
- Important: Method overload for Objective-C usage.
refreshAccessToken(with:additionalParameters:completionHandler:)
Refreshes an access token by providing a refresh token.
If it succeeds then a SuccessfulTokenResponse
with the access token is returned.
If it fails either an ErrorTokenResponse
with the error reason is returned or the result has an Error
.
- Parameters:
- refreshToken: The refresh token.
- additionalParameters: The additional parameters for the request body. The default value is nil.
- completionHandler: A completion handler that is called when
refreshAccessToken
is complete.
- Important: Method overload for Objective-C usage.
revokeRefreshToken(with:completionHandler:)
Revokes a refresh token.
If it succeeds then a successfulRevocation
is returned.
If it fails an error
response is returned containing an Error
.
- Parameters:
- token: The token to be revoked.
- completionHandler: A completion handler that is called when
revokeRefreshToken
is complete.
- Important: Method overload for Objective-C usage.