Skip to content

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

Open
@kdy1

Description

@kdy1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions