-
Notifications
You must be signed in to change notification settings - Fork 335
Validating Google aud field throws an error #110
Copy link
Copy link
Closed
Description
I have the following code that creates a validation struct and decodes a token:
let aud =
"my-googleclientid1234.apps.googleusercontent.com".to_string();
let mut aud_hashset = HashSet::new();
aud_hashset.insert(aud);
let validation = Validation {
algorithms: vec![Algorithm::RS256],
aud: Some(aud_hashset),
..Validation::default()
};
let token_data_rsa = jwt::decode_rsa_components::<GooglePayload>(&token, &n, &e, &validation);
But it throws an error:
Err(Error(Json(Error("invalid type: string \"my-googleclientid1234.apps.googleusercontent.com\", expected a sequence", line: 0, column: 0))))
If I don't try to validate the aud field, then the token decodes as expected.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels