TabTokenStorage class
Keeps one tab's tokens in a KeyValueStore, under keys that carry tabKey.
Epic's "Embedding in Multiple Tabs" guidance (fhir.epic.com
Documentation) says Hyperspace can show several patients at once, each in
its own embedded tab, and that its browser does not keep session storage
apart per tab: "If your app stores tab-specific data in session storage,
you need to use the unique tabId from above to store off this data per
tab." tabKey is that tab id. The same-window login uses the OAuth
state of the login that opened the tab, which stays in the tab's URL.
- Implemented types
Constructors
- TabTokenStorage({required KeyValueStore store, required String tabKey})
-
Store tokens for the tab named
tabKeyinstore.
Properties
- authStateKey → String
-
The key the authentication state is stored under.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- store → KeyValueStore
-
Where the values live;
window.sessionStoragein a browser.final - tabKey → String
-
The tab these tokens belong to.
final
- tokensKey → String
-
The key the tokens are stored under.
no setter
Methods
-
clearTokens(
) → Future< void> -
Clear all tokens
override
-
hasTokens(
) → Future< bool> -
Check if tokens exist
override
-
loadAuthState(
) → Future< AuthState?> -
Load authentication state
override
-
loadTokens(
) → Future< SmartTokenResponse?> -
Load tokens from storage
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
saveAuthState(
AuthState state) → Future< void> -
Save authentication state
override
-
saveTokens(
SmartTokenResponse tokens) → Future< void> -
Save tokens securely
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited