Credential class
A credential presented by a connecting party (client or node) during the authentication handshake.
Two built-in shapes are supported: a bearer token and an Ed25519 public key with a signature over the server-issued challenge. Authenticators inspect the fields relevant to them.
- Annotations
-
- @immutable
Constructors
- Credential({required String principal, String? token, String? publicKey, String? signature})
-
Creates a credential.
const
- Credential.token({required String principal, required String token})
-
A token credential.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- principal → String
-
The claimed principal id (account name).
final
- publicKey → String?
-
A base64 Ed25519 public key, if public-key auth is used.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signature → String?
-
A base64 signature over the auth challenge, paired with publicKey.
final
- token → String?
-
A bearer token, if token auth is used.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - JSON form (used inside the auth control message).
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited