[][src]Function alcoholic_jwt::token_kid

pub fn token_kid(token: &str) -> Result<Option<String>, ValidationError>

Attempt to extract the kid-claim out of a JWT's header claims.

This function is normally used when a token provider has multiple public keys in rotation at the same time that could all still have valid tokens issued under them.

This is only safe if the key set containing the currently allowed key IDs is fetched from a trusted source.