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

[Bug] BaseBearerTokenAuthenticationProvider.authenticate_request does not refresh token with authorization header is present #670

Closed
michaeldcanady opened this issue Feb 28, 2024 · 2 comments
Labels

Comments

@michaeldcanady
Copy link

Describe the bug
When authentication a request the method authenticate_request fails to refresh an expired JWT token.

To Reproduce
Steps to reproduce the behavior:

  1. preform any graph request requiring a token
  2. verify request.headers has "authorization" key
  3. wait until bearer token is expired
  4. you will receive the following error "unable to parse claims from response" - upstream error due to having a bad token

Expected behavior
once expired authenticate_request should retrieve a new token.

What you see instead
Paste the sample output, or add screenshots to help explain your problem.

The MSAL Python version you are using
Paste the output of this
1.26.0

Additional context
Add any other context about the problem here.

@rayluo
Copy link
Collaborator

rayluo commented Feb 29, 2024

To Reproduce Steps to reproduce the behavior:

1. preform any graph request requiring a token

2. verify request.headers has "authorization" key

3. wait until bearer token is expired

4. you will receive the following error "unable to parse claims from response" - upstream error due to having a bad token

Hey, @michaeldcanady , in our bug template, the first step was "1. Go to our off-the-shelf samples and pick one that is closest to your usage scenario. You should not need to modify the sample." Can you share what sample you actually use, rather than just providing your high level steps? Just looking into your steps, it sounds like your app did not even attempt token refresh between your step 3 & 4. But our off-the-shelf samples should have already taken care of that.

@michaeldcanady
Copy link
Author

Hey @rayluo! I put this on the wrong repo by mistake, I migrated the issue to microsoft/kiota-python#237, where it's applicable!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants