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
TokenStoreManager
class.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
tokenStoreManaging
The new token store manager to be used.
-
Clears the token store by invoking the
clear
method on the active token store manager.Declaration
Swift
public func clear()
-
Retrieves the
OAuth2Token
for the given URLDeclaration
Swift
public func get(for url: URL) throws -> OAuth2Token?
Parameters
url
the 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.