OAuthClient class

Represents an OAuth client registered with this application.

Constructors

OAuthClient({required String clientId, required String clientSecretHash, required String name, required List<String> redirectUris, String? description, List<String> grantTypes = const ['authorization_code'], List<String> scopes = const ['openid', 'profile', 'email'], String tokenEndpointAuthMethod = 'client_secret_basic', DateTime? createdAt, DateTime? updatedAt, bool enabled = true})
Creates a registered client.
const
OAuthClient.fromJson(Map<String, dynamic> json)
Creates a client from JSON.
factory

Properties

clientId → String
Unique client identifier.
final
clientSecretHash → String
Hashed client secret (never plaintext).
final
createdAt → DateTime?
When the client was registered.
final
description → String?
Optional client description.
final
enabled → bool
Whether the client is enabled.
final
grantTypes → List<String>
Supported grant types (e.g., 'authorization_code', 'client_credentials').
final
hashCode → int
The hash code for this object.
no setterinherited
name → String
Human-readable client name.
final
redirectUris → List<String>
Allowed redirect URIs for this client.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scopes → List<String>
Allowed scopes.
final
tokenEndpointAuthMethod → String
Token endpoint authentication method.
final
updatedAt → DateTime?
When the client was last updated.
final

Methods

copyWith({String? clientSecretHash, String? name, String? description, List<String>? redirectUris, List<String>? grantTypes, List<String>? scopes, String? tokenEndpointAuthMethod, DateTime? updatedAt, bool? enabled}) → OAuthClient
Creates a copy with selected fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes client metadata without clientSecretHash.
toStorageJson() → Map<String, dynamic>
Serializes client metadata for storage, including the secret hash.
toString() → String
A string representation of this object.
inherited

Operators

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