OAuth2TokenStorage

open class OAuth2TokenStorage : OAuth2TokenStore
extension OAuth2TokenStorage: OAuth2TokenStoreUserInfoTransforming

Default implementation for the OAuth2TokenStore.

  • Stores the OAuth2Token for the given URL.

    Declaration

    Swift

    open func store(token: OAuth2Token, for url: URL) throws

    Parameters

    token

    the token to be stored

    for

    the url the token is associated to

  • Retrieves the OAuth2Token for the given URL.

    Declaration

    Swift

    open func token(for url: URL) throws -> OAuth2Token?

    Parameters

    url

    the url which the token is needed for

    Return Value

    the token associated with the url, nil if not found

  • Deletes the OAuth2Token for the given URL.

    Declaration

    Swift

    open func deleteToken(for url: URL) throws

    Parameters

    url

    the url which the token is no longer needed

  • Default key prefix for storing OAuth2Tokens.

    Declaration

    Swift

    public static let keyPrefix: String
  • Default key handler.

    Declaration

    Swift

    public class func key(for url: URL) -> String
  • Declaration

    Swift

    public func toUserInfo() throws -> [String : Any]
  • Declaration

    Swift

    public func apply(userInfo: [String : Any]) throws