AuthConfig class final
AUTH_* / JWT_* configuration (config/auth.php parity).
- Implemented types
Constructors
- AuthConfig({String defaultGuard = 'token', Duration? tokenExpiration, String tokenTable = 'personal_access_tokens', String tokenPrefix = '', String? jwtSecret, JwtAlgorithm jwtAlgorithm = .hs256, Duration jwtTtl = const Duration(minutes: 60), Duration jwtLeeway = const Duration(seconds: 30), String? jwtIssuer, String? jwtAudience, String? jwtPublicKey, String? jwtPrivateKey, String? jwtKid, String? jwtSubjectClass, String? jwtIssuerClaim})
-
Auth settings; usually from
.env(AuthConfig.fromEnv).const - AuthConfig.fromEnv(Env env)
-
The settings in
AUTH_*,JWT_*andSANCTUM_*.factory
Properties
- defaultGuard → String
-
The guard used when none is named (
AUTH_GUARD,token).final - hashCode → int
-
The hash code for this object.
no setterinherited
- jwtAlgorithm → JwtAlgorithm
-
The JWT signing algorithm (
JWT_ALGO).final - jwtAudience → String?
-
The
audclaim written and required (JWT_AUDIENCE).final - jwtIssuer → String?
-
The
issclaim written and required (JWT_ISSUER).final - jwtIssuerClaim → String?
-
The
isswritten into issued tokens but not checked (JWT_ISSUER_CLAIM, elseAPP_URL): tymon/jwt-auth writes the login URL and requires the claim without checking it.JWT_ISSUER, by contrast, is required to match on every token.final - jwtKid → String?
-
The key id written in the JWT header.
final
- jwtLeeway → Duration
-
The clock skew allowed when checking a JWT.
final
- jwtPrivateKey → String?
-
Base64 Ed25519 32-byte seed (EdDSA signing).
final
- jwtPublicKey → String?
-
Base64 Ed25519 public key (EdDSA).
final
- jwtSecret → String?
-
HS256 secret; falls back to
APP_KEYwhen unset.final - jwtSubjectClass → String?
-
The Laravel model class of the token's subject (
JWT_SUBJECT_CLASS, e.g.App\Models\User), for tokens shared with tymon/jwt-auth and itslock_subject: issued tokens carryprv(the sha1 of this name),nbfandiss, and a token whoseprvdiffers is refused.final - jwtTtl → Duration
-
How long a JWT is valid (
JWT_TTL).final - key → String
-
Top-level key of the section, e.g.
appordatabase.no setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tokenExpiration → Duration?
-
Sanctum-style global token lifetime (
AUTH_TOKEN_EXPIRATIONminutes).final - tokenPrefix → String
-
Prefix for new token secrets (
SANCTUM_TOKEN_PREFIX, as in Sanctum).final - tokenTable → String
-
The personal access tokens table, shared with Sanctum.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, Object?> -
Plain-map projection used for dot-notation access.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited