ENUM
HaapiModel.TokenResponseFactory
Contents
- Methods
success(accessToken:tokenType:scope:expiresIn:refreshToken:idToken:)error(error:errorDescription:errorUri:)
enum TokenResponseFactory
Provides functionality to build instances of Token responses as defined in RFC 6749.
Methods
success(accessToken:tokenType:scope:expiresIn:refreshToken:idToken:)
public static func success(accessToken: String,
tokenType: String?,
scope: String?,
expiresIn: Int,
refreshToken: String?,
idToken: String?) -> SuccessfulTokenResponse
Creates an instance of SuccessfulTokenResponse model.
-
Parameters:
- accessToken: The AccessToken string.
- tokenType: The token type.
- scope: The associated scope.
- expiresIn: The expected lifetime of the token.
- refreshToken: The refresh token if any.
- idToken: The associated ID Token for the authenticated session.
-
Returns: A built instance of
SuccessfulTokenResponse.
Parameters
| Name | Description |
|---|---|
| accessToken | The AccessToken string. |
| tokenType | The token type. |
| scope | The associated scope. |
| expiresIn | The expected lifetime of the token. |
| refreshToken | The refresh token if any. |
| idToken | The associated ID Token for the authenticated session. |
error(error:errorDescription:errorUri:)
public static func error(
error: String,
errorDescription: String?,
errorUri: String? = nil
) -> ErrorTokenResponse
Creates an instance of ErrorTokenResponse model.
-
Parameters:
- error: The error code.
- errorDescription: A human readable error description. Provides additional error information.
- errorUri: A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error.
-
Returns: A built instance of
ErrorTokenResponse.
Parameters
| Name | Description |
|---|---|
| error | The error code. |
| errorDescription | A human readable error description. Provides additional error information. |
| errorUri | A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error. |