init(value:)
See JWTClaim
.
init(value: [String])
See JWTClaim
.
init(value: [String])
import JWTKit
🔑 JSON Web Token signing and verification (HMAC, RSA, PSS, ECDSA, EdDSA) using SwiftCrypto.
struct AudienceClaim
The “aud” (audience) claim identifies the recipients that the JWT is intended for. Each principal intended to process the JWT MUST identify itself with a value in the audience claim. If the principal processing the claim does not identify itself with a value in the “aud” claim when this claim is present, then the JWT MUST be rejected. In the general case, the “aud” value is an array of case- sensitive strings, each containing a StringOrURI value. In the special case when the JWT has one audience, the “aud” value MAY be a single case-sensitive string containing a StringOrURI value. The interpretation of audience values is generally application specific. Use of this claim is OPTIONAL.
protocol JWTClaim : Decodable, Encodable, Sendable
A claim is a codable, top-level property of a JWT payload. Multiple claims form a payload. Some claims, such as expiration claims, are inherently verifiable. Each claim able to verify itself provides an appropriate method for doing so, depending on the specific claim.
@frozen struct String
A Unicode string value that is a collection of characters.
init(stringLiteral value: String)
See ExpressibleByStringLiteral
.
var value: [String]
See JWTClaim
.
func verifyIntendedAudience(includes audience: String) throws
Verify that the given audience is included as one of the claim’s intended audiences by simple string comparison.