firestore-db-and-auth-rs
firestore-db-and-auth-rs copied to clipboard
Access tokens created from UserSession::by_user_id cannot be used with UserSession::by_access_token
Describe the bug
The code below
let sess = UserSession::by_user_id(&cred, &format!("test_{}", uid), false)
.expect("failed to create a user session");
let token = sess.access_token();
UserSession::by_access_token(&cred, &token).expect("invalid test token");
panic with invalid test token: Generic("No secret for kid")
The header of created jwt is
{
"alg": "RS256",
"kid": "tB0M2A"
}
To Reproduce Steps to reproduce the behavior:
- Create an access token with
UserSession::by_user_id - Pass the access token to
UserSession::by_access_token
Expected behavior Works without any issue.