AuthenticationResult
public struct AuthenticationResult
The result of an authentication request sent to the Symonds Data Service.
-
The provided access token, usable for the amount of time specified by
expiresIn
.Declaration
Swift
public let accessToken: String
-
The amount of time after which the access token will expire.
Declaration
Swift
public let expiresIn: Int
-
The type of token provided.
Declaration
Swift
public let tokenType: String
-
The scope of the provided token.
Declaration
Swift
public let scope: String
-
A refresh token that can be used to retrieve another access token.
Declaration
Swift
public let refreshToken: String
-
A string key used for persisting
refreshToken
in Keychain.Declaration
Swift
private static let refreshTokenKey = "refreshToken"
-
Creates an instance of
AuthenticationResult
.Declaration
Swift
internal init(accessToken: String, expiresIn: Int, tokenType: String, scope: String, refreshToken: String)
Parameters
accessToken
The access token.
expiresIn
The amount of time before expiration.
tokenType
The type of token.
scope
The scope of the token.
refreshToken
The refresh token.
-
Saves
refreshToken
into Keychain.Declaration
Swift
public func saveRefreshTokenToKeychain()
-
Reads a refresh token value from Keychain.
Declaration
Swift
public static func readRefreshToken() -> String?
Return Value
The token if found, otherwise
nil
.