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

Feat: OAuth2: Show details of both token request and user request in the Timeline #2253

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

pietrygamat
Copy link
Contributor

@pietrygamat pietrygamat commented May 6, 2024

Description

This PR builds on top of both #2077 and #2164 . It enhances the timeline to show the details of both OAuth2 token request and user defined request.
This is done because:

When token request is executed, both requests are logged:
Screenshot from 2024-05-06 23-03-43

When using cached credentials (previously obtained access_token), only user request is shown:
Screenshot from 2024-05-06 23-19-15

Also, fixes #1933

@pietrygamat pietrygamat force-pushed the feature/inherit-oauth+basic-auth-client-credentials branch from 420c3cb to 0c1e1ab Compare May 7, 2024 18:00
Mateusz Pietryga and others added 17 commits May 7, 2024 20:03
… of api endpoint

Setting oauth2 authorization no longer equals overwriting user-specified data in a request. The pre-requests made to obtain oauth2 access_token are now separated from actual API request.

usebruno#1999
Results of oauth2 authorization flow (i.e. access_token but also refresh_token, id_token, scope or any other information returned from token request) are stored in a collection specific cache. It is persisted in the file system, and will be automatically reused when executing requests until the cache is purged (using Clear Cache button available in all related views).
…able by scripts

The new variable 'credentials' is now available in 'req' object. It is added automatically during request preparation if oauth2 method is used and is value is either evaluated or retrieved from collection oauth2 cache.
…Token action

The actual the authorization request is now part of request preparation, and its response is returned for post-request script processing.
According to RFC6749 Section 7.1, The client MUST NOT use an access token
if it does not understand the token type.
At this point bruno only understands 'bearer' token_type.
@pietrygamat pietrygamat force-pushed the feature/inherit-oauth+basic-auth-client-credentials branch from 0c1e1ab to edd0088 Compare May 7, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Oauth2.0 - client Credentials -> Get Access Token =>not good URL?
1 participant