Function jsonwebtoken::decode_header
source ยท pub fn decode_header(token: &str) -> Result<Header>
Expand description
Decode a JWT without any signature verification/validations and return its Header.
If the token has an invalid format (ie 3 parts separated by a .
), it will return an error.
use jsonwebtoken::decode_header;
let token = "a.jwt.token".to_string();
let header = decode_header(&token);