ENUM

HaapiModel.TokenResponseFactory

Contents

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

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

Name Description
error The error code.
errorDescription A human readable error description. Provides additional error information.