mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-23 12:45:38 +00:00
feat: OAuth2 - automatically handle Bearer token type only
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.
This commit is contained in:
@@ -284,7 +284,13 @@ const configureRequest = async (
|
||||
}
|
||||
request.credentials = credentials;
|
||||
request.authRequestResponse = response;
|
||||
request.headers['Authorization'] = `Bearer ${credentials.access_token}`;
|
||||
|
||||
// Bruno can handle bearer token type automatically.
|
||||
// Other - more exotic token types are not touched
|
||||
// Users are free to use pre-request script and operate on req.credentials.access_token variable
|
||||
if (credentials?.token_type.toLowerCase() === 'bearer') {
|
||||
request.headers['Authorization'] = `Bearer ${credentials.access_token}`;
|
||||
}
|
||||
}
|
||||
|
||||
if (request.awsv4config) {
|
||||
|
||||
Reference in New Issue
Block a user