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

[1.2.x] Scopes are not populating properly in the runtime:principal for cached oauth2 tokens #33539

Closed
chashikajw opened this issue Oct 31, 2021 · 1 comment
Labels
Team/StandardLibs All Ballerina standard libraries Type/Bug

Comments

@chashikajw
Copy link

chashikajw commented Oct 31, 2021

Description:
Authorization fails when using a previously used access token. This issue happens because of scopes are not populating properly in the runtime:principal for cached oauth2 tokens
Steps to reproduce:

Following logs can be observed for the API calls and in the second API call, scopes are not attached to the cache key. Cache keys are different for the same oauth2 token (second key the scopes are missing).

  1. First API call
    2021-10-29 15:10:15,735 DEBUG [ballerina/cache] - Cache entry from the given key: admin@carbon.super-Consumer_hyphen_Data_hyphen_Standards__v1-getb9a42d1a61864a709d93108ef2f2e63c-GET-default,, is not available. 2021-10-29 15:10:15,739 DEBUG [ballerina/cache] - Cache entry from the given key: admin@carbon.super-Consumer_hyphen_Data_hyphen_Standards__v1-getb9a42d1a61864a709d93108ef2f2e63c-GET-default,, is not available.

  2. Second API call
    2021-10-29 15:12:10,602 DEBUG [ballerina/cache] - Cache entry from the given key: admin@carbon.super-Consumer_hyphen_Data_hyphen_Standards__v1-getb9a42d1a61864a709d93108ef2f2e63c-GET, is not available. 2021-10-29 15:12:10,603 DEBUG [ballerina/cache] - Cache entry from the given key: admin@carbon.super-Consumer_hyphen_Data_hyphen_Standards__v1-getb9a42d1a61864a709d93108ef2f2e63c-GET, is not available.

Affected Versions:
1.2.x

OS, DB, other environment details and versions:
Microgateway-toolkit-3.2

@ldclakmal ldclakmal added the Team/StandardLibs All Ballerina standard libraries label Oct 31, 2021
@chashikajw chashikajw changed the title [1.2.x] Scopes are not populating properly in the runtime:principal for caches oauth2 tokens [1.2.x] Scopes are not populating properly in the runtime:principal for cached oauth2 tokens Oct 31, 2021
@ldclakmal
Copy link
Member

Fixed with the above PR. Hence closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/StandardLibs All Ballerina standard libraries Type/Bug
Projects
None yet
Development

No branches or pull requests

2 participants