object
jwt
Facade predicates for parsing, signing, verifying, and validating JSON Web Tokens.
logtalk_load(jwt(loader))static, context_switching_callsPublic predicates
decode/3
Decodes a compact JWT into header and claims JSON terms without verifying the signature.
staticdecode(Token,Header,Claims)decode(+atom,-term,-term) - one_or_errorToken is a variable:instantiation_errorToken is neither a variable nor an atom:type_error(atom,Token)Token is an atom but not a valid compact JWT:domain_error(jwt_compact_serialization,Token)Token contains Base64URL data with characters outside the Base64URL alphabet:representation_error(base64)decode/5
Decodes a compact JWT into header, claims, signature bytes, and signing input.
staticdecode(Token,Header,Claims,Signature,SigningInput)decode(+atom,-term,-term,-list(byte),-atom) - one_or_errorToken is a variable:instantiation_errorToken is neither a variable nor an atom:type_error(atom,Token)Token is an atom but not a valid compact JWT:domain_error(jwt_compact_serialization,Token)Token contains Base64URL data with characters outside the Base64URL alphabet:representation_error(base64)header/2
Decodes only the JWT header JSON term.
staticheader(Token,Header)header(+atom,-term) - one_or_errorToken is a variable:instantiation_errorToken is neither a variable nor an atom:type_error(atom,Token)Token is an atom but not a valid compact JWT:domain_error(jwt_compact_serialization,Token)Token contains Base64URL data with characters outside the Base64URL alphabet:representation_error(base64)claims/2
Decodes only the JWT claims JSON term.
staticclaims(Token,Claims)claims(+atom,-term) - one_or_errorToken is a variable:instantiation_errorToken is neither a variable nor an atom:type_error(atom,Token)Token is an atom but not a valid compact JWT:domain_error(jwt_compact_serialization,Token)Token contains Base64URL data with characters outside the Base64URL alphabet:representation_error(base64)claim/3
Looks up a claim value by name in a claims JSON term.
staticclaim(Claims,Name,Value)claim(+term,+atom,-term) - zero_or_onepeek_algorithm/2
Decodes the JWT header and returns its algorithm.
staticpeek_algorithm(Token,Algorithm)peek_algorithm(+atom,-atom) - one_or_errorToken is a variable:instantiation_errorToken is neither a variable nor an atom:type_error(atom,Token)Token is an atom but not a valid compact JWT:domain_error(jwt_compact_serialization,Token)Token contains Base64URL data with characters outside the Base64URL alphabet:representation_error(base64)alg member:domain_error(jwt_header,Header)peek_key_id/2
Decodes the JWT header and returns its optional key identifier.
staticpeek_key_id(Token,KeyId)peek_key_id(+atom,-atom) - zero_or_oneverify/4
Verifies a compact JWT using a key or JWK Set and returns the claims.
staticverify(Token,KeyOrJWKSet,Claims,Options)verify(+atom,+term,-term,+list(compound)) - zero_or_one_or_errorOptions is a variable or a partial list:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)Token is a variable:instantiation_errorToken is neither a variable nor an atom:type_error(atom,Token)Token is an atom but not a valid compact JWT:domain_error(jwt_compact_serialization,Token)Token contains Base64URL data with characters outside the Base64URL alphabet:representation_error(base64)alg member:domain_error(jwt_header,Header)domain_error(jwt_algorithm,Algorithm)KeyOrJWKSet is not a JSON Web Key Set with a keys list:domain_error(jwt_jwks,KeyOrJWKSet)existence_error(jwt_jwk,Header)KeyOrJWKSet is not a valid symmetric key:domain_error(jwt_symmetric_key,KeyOrJWKSet)KeyOrJWKSet is not a supported public JWK:domain_error(jwt_jwk_public_key,KeyOrJWKSet)domain_error(jwt_es256_signature,Signature)existence_error(os_command,Executable)domain_error(jwt_claims,missing(Name))domain_error(jwt_claim(Name),Value)type_error(time_number,Name-Time)verify/5
Verifies a compact JWT using a key or JWK Set and returns the header and claims.
staticverify(Token,Header,Claims,KeyOrJWKSet,Options)verify(+atom,-term,-term,+term,+list(compound)) - zero_or_one_or_errorOptions is a variable or a partial list:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)Token is a variable:instantiation_errorToken is neither a variable nor an atom:type_error(atom,Token)Token is an atom but not a valid compact JWT:domain_error(jwt_compact_serialization,Token)Token contains Base64URL data with characters outside the Base64URL alphabet:representation_error(base64)alg member:domain_error(jwt_header,Header)domain_error(jwt_algorithm,Algorithm)KeyOrJWKSet is not a JSON Web Key Set with a keys list:domain_error(jwt_jwks,KeyOrJWKSet)existence_error(jwt_jwk,Header)KeyOrJWKSet is not a valid symmetric key:domain_error(jwt_symmetric_key,KeyOrJWKSet)KeyOrJWKSet is not a supported public JWK:domain_error(jwt_jwk_public_key,KeyOrJWKSet)domain_error(jwt_es256_signature,Signature)existence_error(os_command,Executable)domain_error(jwt_claims,missing(Name))domain_error(jwt_claim(Name),Value)type_error(time_number,Name-Time)verify_signature/5
Verifies a JWS signature for a signing input, algorithm, key, and options.
staticverify_signature(Algorithm,SigningInput,Signature,Key,Options)verify_signature(+atom,+atom,+list(byte),+term,+list(compound)) - zero_or_one_or_errorOptions is a variable or a partial list:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)Algorithm is unsupported or disallowed:domain_error(jwt_algorithm,Algorithm)Key is not a valid symmetric key:domain_error(jwt_symmetric_key,Key)Key is not a supported public JWK:domain_error(jwt_jwk_public_key,Key)Signature is not a 64-byte raw ES256 signature:domain_error(jwt_es256_signature,Signature)existence_error(os_command,Executable)sign/5
Signs claims as a compact JWT using the given header, key, and options.
staticsign(Header,Claims,Key,Token,Options)sign(+term,+term,+term,-atom,+list(compound)) - one_or_errorOptions is a variable or a partial list:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)Header does not contain a valid alg member:domain_error(jwt_header,Header)domain_error(jwt_algorithm,Algorithm)Header or Claims cannot be encoded as JSON:domain_error(json_sink,HeaderOrClaims)Key is not a valid symmetric key:domain_error(jwt_symmetric_key,Key)Algorithm is not a supported signing algorithm:domain_error(jwt_signing_algorithm,Algorithm)sign_payload/5
Signs a payload JSON term as a compact JWS using the given header, key, and options.
staticsign_payload(Header,Payload,Key,Token,Options)sign_payload(+term,+term,+term,-atom,+list(compound)) - one_or_errorOptions is a variable or a partial list:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)Header does not contain a valid alg member:domain_error(jwt_header,Header)domain_error(jwt_algorithm,Algorithm)Header or Payload cannot be encoded as JSON:domain_error(json_sink,HeaderOrPayload)Key is not a valid symmetric key:domain_error(jwt_symmetric_key,Key)Algorithm is not a supported signing algorithm:domain_error(jwt_signing_algorithm,Algorithm)validate_claims/3
Validates JWT claims using registered-claim defaults, a policy list, and options.
staticvalidate_claims(Claims,Policy,Options)validate_claims(+term,+list(compound),+list(compound)) - one_or_errorOptions is a variable or a partial list:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)domain_error(jwt_claims,missing(Name))domain_error(jwt_claim(Name),Value)Policy contains an invalid claim policy:domain_error(jwt_claim_policy,Policy)type_error(time_number,Name-Time)Policy contains an invalid time-claim kind:domain_error(jwt_time_claim_kind,Kind)validate_claim/3
Validates a single JWT claim policy against a claims JSON term.
staticvalidate_claim(Claims,ClaimPolicy,Options)validate_claim(+term,+compound,+list(compound)) - one_or_errordomain_error(jwt_claims,missing(Name))domain_error(jwt_claim(Name),Value)ClaimPolicy is not a valid claim policy:domain_error(jwt_claim_policy,ClaimPolicy)type_error(time_number,Name-Time)ClaimPolicy contains an invalid time-claim kind:domain_error(jwt_time_claim_kind,Kind)Protected predicates
(no local declarations; see entity ancestors if any)
Private predicates
(no local declarations; see entity ancestors if any)
Operators
(none)