AuthDeviceAuthorization class final

A persisted device authorization request.

Both the device code and user code are stored as digests. The raw values exist only in the response that starts the flow and in the user-entered approval request.

Constructors

AuthDeviceAuthorization({required String id, required String deviceCodeHash, required String userCodeHash, required String clientId, required List<String> scopes, required DateTime createdAt, required DateTime expiresAt, required Duration interval, AuthDeviceAuthorizationStatus status = AuthDeviceAuthorizationStatus.pending, String? userId, DateTime? approvedAt, DateTime? deniedAt, DateTime? lastPolledAt, String? issuanceLeaseDigest, DateTime? issuanceLeaseExpiresAt, DateTime? consumedAt})
Creates a persisted device authorization record.

Properties

approvedAt DateTime?
Time at which the request was approved.
final
clientId String
OAuth client bound to the request.
final
consumedAt DateTime?
Time at which token issuance consumed the request.
final
createdAt DateTime
Time at which the request was created.
final
deniedAt DateTime?
Time at which the request was denied.
final
deviceCodeHash String
Digest of the raw device code used for polling.
final
expiresAt DateTime
Expiry deadline; polling and approval fail at or after this time.
final
hashCode int
The hash code for this object.
no setterinherited
id String
Durable identifier for this authorization transaction.
final
interval Duration
Current minimum polling interval.
final
issuanceLeaseDigest String?
Digest identifying the active issuance lease, when present.
final
issuanceLeaseExpiresAt DateTime?
Expiry of the active issuance lease, bounded by expiresAt.
final
lastPolledAt DateTime?
Time of the latest accepted poll.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scopes List<String>
Scopes requested by the client.
final
status AuthDeviceAuthorizationStatus
Approval and issuance state of the request.
final
userCodeHash String
Digest of the user-entered verification code.
final
userId String?
User who approved the request, when approved.
final

Methods

copyWith({AuthDeviceAuthorizationStatus? status, String? userId, DateTime? approvedAt, DateTime? deniedAt, DateTime? lastPolledAt, Duration? interval, String? issuanceLeaseDigest, DateTime? issuanceLeaseExpiresAt, DateTime? consumedAt, bool clearIssuanceLease = false}) AuthDeviceAuthorization
Creates a copy with selected lifecycle fields replaced.
isExpired({DateTime? now}) bool
Whether now is at or after expiresAt.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toStorageJson() Map<String, dynamic>
Serializes only persistence-safe metadata. Raw codes are never included.
toString() String
A string representation of this object.
inherited

Operators

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