TokenInfo

public class TokenInfo : Codable
extension TokenInfo: Equatable

Info about the tokens used by the SDK for authentication.

Properties

  • The access token

    Declaration

    Swift

    public let accessToken: String
  • The refresh token for this access token, which can be used to request a new access token when the current one expires

    Declaration

    Swift

    public let refreshToken: String?
  • The time in seconds by which this token will expire

    Declaration

    Swift

    public let expiresIn: TimeInterval
  • The type of access token returned

    Declaration

    Swift

    public let tokenType: String
  • Expiration date of the token

    Declaration

    Swift

    public let expiresAt: Date
  • The type of downscoped access token returned. This is only returned if an access token has been downscoped

    Declaration

    Swift

    public let issuedTokenType: String?
  • The permissions that this access token permits, providing a list of resources (files, folders, etc) and the scopes permitted for each of those resources

    Declaration

    Swift

    public var restrictedToObjects: [[String : Any]] { get }
  • Declaration

    Swift

    public required init(from decoder: Decoder) throws
  • Initializer

    Declaration

    Swift

    public init(accessToken: String, refreshToken: String?, expiresIn: TimeInterval, tokenType: String)

    Parameters

    accessToken

    Access token.

    refreshToken

    Refresh token.

    expiresIn

    Expiration date of the token.

    tokenType

    Type of the token.

  • Initializer.

    Declaration

    Swift

    public init(accessToken: String, expiresIn: TimeInterval)

    Parameters

    accessToken

    Access token.

    expiresIn

    Expiration date of the token.

  • Compares tokens

    Declaration

    Swift

    public static func == (lhs: TokenInfo, rhs: TokenInfo) -> Bool

    Parameters

    lhs

    First token

    rhs

    Second tken

    Return Value

    True in case tokens are the same, false otherwise.