Skip to main content

decode

Function decode 

Source
pub fn decode(
    token: &str,
    verifying_key: &VerifyingKey,
    expected_aud: Option<&str>,
) -> Result<Claims, JwtError>
Expand description

Decode and verify a JWT token issued by the local node.

For tokens from foreign issuers (federation), use decode_with_key with the key obtained from FederationKeyResolver::get_key.

Uses strict audience validation: if expected_aud is Some, the token must have a matching aud claim (absent aud is rejected).