OAuth2TokenStore

public protocol OAuth2TokenStore

Defines a protocol which is capable of storing an OAuth2Token.

  • Stores the OAuth2Token for the given URL.

    Declaration

    Swift

    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

    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

    func deleteToken(for url: URL) throws

    Parameters

    url

    the url which the token is no longer needed

  • clear() Default implementation

    Clears the tokens

    Default Implementation

    Default implementation of clear method, does nothing.

    Declaration

    Swift

    func clear()