ENUM
HaapiModel.TokenResponseFactory
Contents
- Methods
success(accessToken:tokenType:scope:expiresIn:refreshToken:idToken:)
error(error:errorDescription:)
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:)
public static func error(error: String, errorDescription: String) -> ErrorTokenResponse
Creates an instance of ErrorTokenResponse
model.
-
Parameters:
- error: The error code.
- errorDescription: A human readable error description. Provides additional error information.
-
Returns: A built instance of
ErrorTokenResponse
.
Parameters
Name | Description |
---|---|
error | The error code. |
errorDescription | A human readable error description. Provides additional error information. |