TypeSafeJWT
public struct TypeSafeJWT
Represents the configuration for TypeSafeJWT authenication: the verification method, and the cache parameters. To avoid the need to verify a token every time it is received, the token cache stores a token with a time-to-live attribute, and skips verification of cached tokens while the TTL is still valid.
-
The verifier to use when verifying tokens. This must be configured before tokens can be successfully authenticated, and should correspond to the JWTSigner used to issue those tokens.
Declaration
Swift
public static var verifier: JWTVerifier?
-
The maximum size of the token cache. Defaults to
0
, which is unlimited.Declaration
Swift
public static var cacheSize: Int
-
The length of time this token should be deemed valid before it must be verified again. Defaults to
nil
, which is unlimited.Declaration
Swift
public static var tokenTimeToLive: TimeInterval?