CLASS
OAuthLifecycle
Contents
- Methods
refreshToken(refreshToken:haapiUIKitApplication:lifecycleResultListener:additionalParameters:)refreshToken(_:haapiUIKitApplication:additionalParameters:)revokeAccessToken(_:haapiUIKitConfiguration:)revokeRefreshToken(_:haapiUIKitConfiguration:)
public class OAuthLifecycle
Oauth Lifecycle Management helper object.
The recommended way to request the framework to refresh an AccessToken is to use OAuthLifecycle.
OAuthLifecycle.refreshToken(
refreshToken: "your-current-refresh-token",
haapiUIKitApplication: haapiUIKitApplication,
lifecycleResultListener: oAuthLifecycleResultListenerImplementation
)
Methods
refreshToken(refreshToken:haapiUIKitApplication:lifecycleResultListener:additionalParameters:)
public static func refreshToken(refreshToken: String,
haapiUIKitApplication: HaapiUIKitApplication,
lifecycleResultListener: OAuthLifecycleResultListener,
additionalParameters: [String: String]? = nil)
Issues a refresh request for the currently held AccessToken.
-
Parameters:
- refreshToken: The refreshToken.
- haapiUIKitApplication: An
HaapiUIKitApplicationinstance. - lifecycleResultListener: An
OAuthLifecycleResultinstance to handle the result. - additionalParameters: The additional parameters for the request body. The default value is nil.
-
Note: Request and response processing execute in the background and the result is delivered in the main thread.
Parameters
| Name | Description |
|---|---|
| refreshToken | The refreshToken. |
| haapiUIKitApplication | An HaapiUIKitApplication instance. |
| lifecycleResultListener | An OAuthLifecycleResult instance to handle the result. |
| additionalParameters | The additional parameters for the request body. The default value is nil. |
refreshToken(_:haapiUIKitApplication:additionalParameters:)
public static func refreshToken(
_ refreshToken: String,
haapiUIKitApplication: HaapiUIKitApplication,
additionalParameters: [String: String]? = nil
) async throws -> OAuthModel
Issues a refresh request for the currently held AccessToken.
- Parameters:
- refreshToken: The refreshToken.
- haapiUIKitApplication: An
HaapiUIKitApplicationinstance. - additionalParameters: The additional parameters for the request body. The default value is nil.
Parameters
| Name | Description |
|---|---|
| refreshToken | The refreshToken. |
| haapiUIKitApplication | An HaapiUIKitApplication instance. |
| additionalParameters | The additional parameters for the request body. The default value is nil. |
revokeAccessToken(_:haapiUIKitConfiguration:)
public static func revokeAccessToken(
_ accessToken: String,
haapiUIKitConfiguration: HaapiUIKitConfiguration
) async throws
Revokes the currently held AccessToken.
- Parameters:
- accessToken: The accessToken.
- haapiUIKitConfiguration: An
HaapiUIKitConfigurationinstance.
Parameters
| Name | Description |
|---|---|
| accessToken | The accessToken. |
| haapiUIKitConfiguration | An HaapiUIKitConfiguration instance. |
revokeRefreshToken(_:haapiUIKitConfiguration:)
public static func revokeRefreshToken(
_ refreshToken: String,
haapiUIKitConfiguration: HaapiUIKitConfiguration
) async throws
Revokes the currently held RefreshToken.
- Parameters:
- refreshToken: The refreshToken.
- haapiUIKitConfiguration: An
HaapiUIKitConfigurationinstance.
Parameters
| Name | Description |
|---|---|
| refreshToken | The refreshToken. |
| haapiUIKitConfiguration | An HaapiUIKitConfiguration instance. |