CLASS

AccessToken

Contents

@objcMembers public class AccessToken: NSObject

A representation of an OAuth Access Token, that includes both the raw value of the token, as well as relevant properties of the token.

Properties

value

public let value: String

The raw value of the Access Token

expiresOn

public let expiresOn: Date

The expiration date of the Access Token

description

override public var description: String

Return a String representation of the AccessToken instance, for example to be used for debugging

Methods

isValid(atTime:minTtl:)

public func isValid(atTime: Date, minTtl: TimeInterval) -> Bool

Calculate whether the Access Token is valid on a particular moment.

The minTtl is used as threshold: the Access Token is considered valid if it is valid for at least minTtl seconds before it expires.

Parameters

Name Description
atTime the moment that validity of the Access Token is calculated for
minTtl a TimeInterval that holds the time period that the Access Token must be valid for until it expires.