TokenStoreManager
public class TokenStoreManager
TokenStoreManager is a singleton that centralizes the management of authentication tokens.
It provides a centralized interface for setting and interacting with different token store implementations, allowing for flexible token management.
-
The Singleton instance of the
TokenStoreManagerclass.Declaration
Swift
public static let shared: TokenStoreManager -
Sets the active token store manager to handle token storage operations.
Declaration
Swift
public func set(tokenStoreManaging: TokenStoreManaging)Parameters
tokenStoreManagingThe new token store manager to be used.
-
Clears the token store by invoking the
clearmethod on the active token store manager.Declaration
Swift
public func clear() -
Retrieves the
OAuth2Tokenfor the given URLDeclaration
Swift
public func get(for url: URL) throws -> OAuth2Token?Parameters
urlthe url which the token is needed for
Return Value
the OAuth2Token associated with the url, Can be nil if OAuth2Token token is not present or an error is thrown when reading the value from store.