@@ -20,69 +20,64 @@ to store the authorization state.
2020public static let instance = AuthorizationManager()
2121```
2222
23+ The shared instance of the AuthorizationManager
24+
2325## Methods
2426### `initialize(configuration:storage :)`
2527
2628```swift
27- public func initialize(configuration: AuthorizationConfiguration , storage : Storage ? = nil)
29+ @discardableResult public func initialize(configuration: AuthorizationConfiguration , storage : Storage ? = nil) -> Self
2830```
2931
30- ### `fusionAuthState()`
31-
32- ```swift
33- public func fusionAuthState() -> FusionAuthState
34- ```
32+ Initialize the AuthorizationManager with the given configuration
3533
3634### `getTokenManager()`
3735
3836```swift
3937public func getTokenManager() -> TokenManager
4038```
4139
42- ### `oauth()`
43-
44- ```swift
45- public func oauth() -> OAuthAuthorizationService
46- ```
40+ Returns the current TokenManager
4741
4842### `freshAccessToken(force:)`
4943
5044```swift
5145public func freshAccessToken(force: Bool = false) async throws -> String?
5246```
5347
48+ Returns a fresh access token
49+
50+ If the access token is not expired, it will be returned immediately.
51+ If the access token is expired or force is `true`, a new access token will be fetched using the refresh token.
52+
5453### `getAccessToken()`
5554
5655```swift
5756public func getAccessToken() -> String?
5857```
5958
59+ Retrieves the access token, if available
60+
6061### `getAccessTokenExpirationTime()`
6162
6263```swift
6364public func getAccessTokenExpirationTime() -> Date?
6465```
6566
67+ Retrieves the access token expiration, if available
68+
6669### `isAccessTokenExpired()`
6770
6871```swift
6972public func isAccessTokenExpired() -> Bool
7073```
7174
72- ### `updateAuthState(authState:)`
73-
74- ```swift
75- public func updateAuthState(authState: OIDAuthState ) throws
76- ```
75+ Checks if the stored access token is expired.
7776
78- ### `updateAuthState(accessToken: accessTokenExpirationTime : idToken : refreshToken : )`
77+ ### `getIdToken( )`
7978
8079```swift
81- public func updateAuthState(accessToken: String , accessTokenExpirationTime : Date , idToken : String , refreshToken : String ) throws
80+ public func getIdToken() -> String?
8281```
8382
84- ### `clearState()`
85-
86- ```swift
87- public func clearState() throws
88- ```
83+ Retrieves the ID token, if available
0 commit comments