Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access tokens created from UserSession::by_user_id cannot be used with UserSession::by_access_token #26

Open
kdy1 opened this issue Jun 10, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@kdy1
Copy link

kdy1 commented Jun 10, 2021

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:

  1. Create an access token with UserSession::by_user_id
  2. Pass the access token to UserSession::by_access_token

Expected behavior
Works without any issue.

@kdy1 kdy1 added the bug Something isn't working label Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant