flutter_robusta_auth library
Robusta auth extension providing security features for Flutter apps. Use it to manage authn and authz.
Classes
- AuthManager
- Service support to login/logout and manage credentials of current user.
- CredentialsMemoryStorage
- Store credentials in memory, when app terminated all data will be lost.
- CredentialsStorage
- Manage user credentials, credentials are JWT token, basic auth token, refresh token, cookie or something to identify current user with upstream.
- FlutterAuthExtension
- An extension providing authn/authz features.
- Identity
- Present for identity using app
- IdentityChangedEvent
- An event dispatch in cases User.currentIdentity changed.
- LoggedInEvent
- An event will be dispatch when user logged-in.
- LoggedOutEvent
- An event will be dispatch when user logged-out.
-
ScreenAccessAbility<
Arg> - Describe screen access with given ability and arg belongs with it.
- ScreenAccessDefinition
- Uses to define screen access control.
- User
- Manages current identity using apps.
Enums
- AccessDecisionStrategy
- Strategy to make decision base on list of access abilities
Mixins
- AccessControl
-
Control access based on
_abilities. - AccessDefinition
-
Defines access
_abilities.
Extensions
- ScreenBaseX on ScreenBase
- Add ability to get current identity using app.
Properties
-
accessControlProvider
→ Provider<
AccessControl> -
Providing access control to manage authorization base on abilities
had define by accessDefinitionProvider.
final
-
accessDefinitionProvider
→ Provider<
AccessDefinition> -
Providing access definition to define access abilities.
final
-
authManagerProvider
→ Provider<
AuthManager> -
Providing auth manager to manage authentication.
final
-
userProvider
→ Provider<
User> -
Providing user of app, use it to get manages current user.
final
Typedefs
- CredentialsStorageFactory = CredentialsStorage Function(ProviderContainer)
- Factory of CredentialsStorage.
- DefineAccess = void Function(AccessDefinition)
- Define access based on ability and rule of it.
- DefineScreenAccess = void Function(ScreenAccessDefinition)
- Define screen access control.
-
IdentityProvider
= FutureOr<
Identity> Function(Map<String, String> , ProviderContainer) - Providing user by credentials and container given, exceptions MUST be throws in cases invalid credentials or something went wrong can't provide user.
-
Rule<
Arg> = FutureOr< bool> Function(Identity?, [Arg? arg]) - The callback to grain access permission for actions of current user when return true otherwise actions should be deny.
-
SimpleIdentityProvider
= FutureOr<
Identity> Function(Map<String, String> ) - Providing user by credentials given, exceptions MUST be throws in cases invalid credentials or something went wrong can't provide user.
Exceptions / Errors
- AccessException
- Access exception
- AuthException
- Auth exception