DVAuth class

Constructors

DVAuth()
const

Properties

apiKeys → DVApiKeyManagement
The current organization's API keys, each operation asked of authorization on a DVApiKeyResource.
no setter
authorization → DVAuthAuthorization
no setter
currentUser → DVAuthUser?
no setter
hashCode → int
The hash code for this object.
no setterinherited
oauthClients → DVOAuthClientManagement
The current organization's OAuth clients, each operation asked of authorization on a DVOAuthClientResource.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

account() → Future<DVAccount>
The signed-in person's account, including an address change waiting for its code.
askForCode(BuildContext context, {int length = 6, String title = 'Enter your code', String? message, DVCodeCheck? verify}) → Future<String?>
Asks for the code that was sent, as a modal over the page.
AskForCodePage({int length = 6, String title = 'Enter your code', String? message, required Future<String?> onCode(String code)}) → Widget
The same question as a whole page.
authorize<TUser, TResource>(TUser user, String action, TResource resource) → Future<void>
can<TUser, TResource>(TUser user, String action, TResource resource) → Future<bool>
changePassword({required String currentPassword, required String newPassword, String? code, String? recoveryCode}) → Future<int>
Changes the password. The server checks currentPassword, breach-checks newPassword, and on an account with an authenticator takes a code or recoveryCode -- or throws DVMfaRequired when neither was given and no factor was presented recently. This device keeps the rotated session; every other device signed in as this person is signed out, and the answer is how many.
code({int length = 6}) → String
A one-time code to send somebody: six digits unless length says otherwise, from a secure random, with its leading zeros kept.
completeSecondFactor({String? code, String? recoveryCode}) → Future<void>
Presents a code from the account's authenticator, or one recovery code, for a sign-in that threw DVMfaRequired. The person is signed in once the server accepts it.
configure(DVAuthProvider provider) → void
confirmEmailChange(String code) → Future<void>
Presents the code sent to the new address; the address changes then.
confirmTotp(String code) → Future<void>
Activates the authenticator being enrolled with a code from it.
deleteAccount({required String password, required bool confirmed, String? code, String? recoveryCode}) → Future<DateTime?>
Deletes the account. confirmed is the person's explicit confirmation, and nothing is sent without it; the server also asks for the password, and a code or recoveryCode when there is a second factor, then hands the person to the project's Data Compliance erasure where one is configured. The device signs out once the server confirms.
DeletePage() → Widget
Deleting the account, behind typed confirmation, the password and the second factor.
enrollTotp() → Future<DVTotpEnrollment>
Starts enrolling an authenticator app: the secret and the otpauth:// URI to show as a QR code. Nothing is active until confirmTotp.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
OAuthConsentPage({required Map<String, String> query, required Uri apiBase, Map<String, String> headers()?, Future<DVHttpResponse> send(DVHttpRequest request)?, void open(String id)?}) → Widget
The screen a person answers a partner's OAuth request on, served at /oauth/consent when dartvel.platformApi.oauth is on.
ProfilePage() → Widget
The account's address, changed only once the new one is verified.
regenerateRecoveryCodes() → Future<DVRecoveryCodes>
A new set of recovery codes, replacing every earlier one, to show once. Throws DVMfaRequired when the second factor is not recent.
registerPolicy<TUser, TResource>(String action, DVPolicyCheck<TUser, TResource> check) → void
removeSecondFactor({String? code, String? recoveryCode}) → Future<void>
Removes the authenticator and every recovery code. Takes a code from the authenticator or one recoveryCode, presented with the request.
requestEmailChange(String email) → Future<void>
Asks for the account's address to become email. A code goes to that address, and nothing changes until confirmEmailChange presents it -- an address that changed unverified is a takeover with a password reset attached.
revoke(String sessionId) → Future<void>
Revokes one device's session by its listed id. Its next request fails; revoking this device's own session signs this device out.
revokeOthers() → Future<int>
Revokes every session of this person except this device's, and answers how many.
SecondFactorPage({String? from}) → Widget
The second-factor challenge: a code from the authenticator app, or one recovery code, for this device's live session.
secondFactors() → Future<DVSecondFactorStatus>
Whether this person has an authenticator app, and how many unspent recovery codes.
SecurityPage() → Widget
Two-factor status, enrollment with a QR code, recovery codes shown once, and removing the authenticator.
sessions() → Future<List<DVSession>>
Every device signed in as this person, newest first, with this one marked current.
SessionsPage() → Widget
Every device signed in as this person, with sign-out for each and for all the others.
signIn() → Future<void>
signInWithBiometrics() → Future<void>
signInWithEmailAndPassword({required String email, required String password}) → Future<void>
SignInWithEmailAndPasswordPage({String? from}) → Widget
Signing in with an e-mail address and a password. Once signed in it goes to from when that is a path in this application -- where the generated account pages' gate was sending the person -- and to / otherwise.
signInWithFaceRecognition() → Future<void>
signInWithFingerprint() → Future<void>
signInWithPasskey() → Future<void>
SignInWithPasskeyPage() → Widget
signInWithProvider(String provider) → Future<void>
SignInWithProviderPage() → Widget
signInWithRawOAuth(Map<String, Object?> oauth) → Future<void>
SignInWithRawOAuthPage() → Widget
signInWithWeb3() → Future<void>
SignInWithWeb3Page() → Widget
signOut() → Future<void>
signUp({String? email, String? password, Map<String, Object?> metadata = const <String, Object?>{}}) → Future<void>
SignUpPage() → Widget
Creating an account with an e-mail address and a password.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

servedByOwnServer ↔ bool
Whether this build is served by its own generated server, which signs accounts up and in at /auth/sign-in.
getter/setter pair

Static Methods

installDefaultProvider(DVAuthProvider? provider) → void
The provider DV.Auth uses when the application configured none. The generated runtime installs one signing in through the application's own backend; configure replaces it.
installStepUp() → void
Makes a generated call refused for a missing second factor present SecondFactorPage over the current screen and send the call again once a factor is presented -- DVStepUp.challenge, unless the application installed its own. Installed by the generated runtime.