OidcDefaultStore class
The default OidcStore implementation for package:oidc
this relies on:
- for the
OidcStoreNamespace.secureTokensnamespace, we useFlutterSecureStorage. - for the
OidcStoreNamespace.sessionnamespace- we use
dart:htmlfor web,- if webSessionManagementLocation is set to OidcDefaultStoreWebSessionManagementLocation.sessionStorage
we use
html.Window.sessionStorage. - if it's set to OidcDefaultStoreWebSessionManagementLocation.sessionStorage we use
html.Window.localStorage.
- if webSessionManagementLocation is set to OidcDefaultStoreWebSessionManagementLocation.sessionStorage
we use
- we use
shared_preferencesfor other platforms
- we use
- for the
OidcStoreNamespace.statenamespace- we use
package:universal_html+localStoragefor web. this is a MUST and other implementations can't change this behavior, for thesamePagenavigation mode to work.
- we use
shared_preferencesfor all other operations.
The non-secure shared_preferences persistence uses the modern
SharedPreferencesAsync API by default (see #301). You can inject your own
instance via the sharedPreferencesAsync constructor parameter to share it
with the rest of your app. The legacy synchronous SharedPreferences path
is still supported through the deprecated sharedPreferences parameter for
backward compatibility. On the default path, this store performs a one-time,
best-effort migration of its own keys from the legacy store into
SharedPreferencesAsync (see OidcDefaultStore.new).
Constructors
- OidcDefaultStore({FlutterSecureStorage? secureStorageInstance, String? storagePrefix = 'oidc', OidcDefaultStoreWebSessionManagementLocation webSessionManagementLocation = OidcDefaultStoreWebSessionManagementLocation.sessionStorage})
-
The default
OidcStoreimplementation forpackage:oidcthis relies on:
Properties
- didInit → bool
-
true if init has been called with no exceptions.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
initMemoizer
↔ AsyncMemoizer<
void> -
Memoizer for the initialization process.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secureStorage ↔ FlutterSecureStorage?
-
instance of
FlutterSecureStorageto use for theOidcStoreNamespace.secureTokensnamespace.getter/setter pair - storagePrefix → String?
-
prefix to put before the keys.
final
- testIsWeb ↔ bool
-
checks if the current platform is web.
getter/setter pair
- webSessionManagementLocation → OidcDefaultStoreWebSessionManagementLocation
-
if true, we use the
sessionStorageon web for theOidcStoreNamespace.sessionnamespace.final
Methods
-
getAllKeys(
OidcStoreNamespace namespace, {String? managerId}) → Future< Set< String> > -
getMany(
OidcStoreNamespace namespace, {required Set< String> keys, String? managerId}) → Future<Map< String, String> > -
init(
) → Future< void> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeMany(
OidcStoreNamespace namespace, {required Set< String> keys, String? managerId}) → Future<void> -
setMany(
OidcStoreNamespace namespace, {required Map< String, String> values, String? managerId}) → Future<void> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
createHardenedSecureStorage(
) → FlutterSecureStorage -
Builds a
FlutterSecureStorageconfigured with the hardened OIDC defaults (recommendedAndroidOptions, recommendedIOSOptions and recommendedMacOsOptions).
Constants
- recommendedAndroidOptions → const AndroidOptions
-
Recommended hardened
AndroidOptionsfor storing OIDC tokens at rest. - recommendedIOSOptions → const IOSOptions
-
Recommended hardened
IOSOptionsfor storing OIDC tokens at rest. - recommendedMacOsOptions → const MacOsOptions
-
Recommended hardened
MacOsOptionsfor storing OIDC tokens at rest.