Skip to content

Commit 1afefb8

Browse files
oauth2: add support for additional parameters in token request body (#42093)
<!-- !!!ATTENTION!!! If you are fixing *any* crash or *any* potential security issue, *do not* open a pull request in this repo. Please report the issue via emailing [email protected] where the issue will be triaged appropriately. Thank you in advance for helping to keep Envoy secure. !!!ATTENTION!!! For an explanation of how to fill out the fields, please see the relevant section in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/main/PULL_REQUESTS.md) --> Commit Message: oauth2: add support for additional parameters in token request body Additional Description: also adds useragent header to the request Risk Level: Testing: Docs Changes: Release Notes: Platform Specific Features: Fixes: #42037 --------- Signed-off-by: Andrea Cappadona <[email protected]> Mirrored from https://github.com/envoyproxy/envoy @ a3662e7b3df451ef0995761b307175544fdd8591
1 parent df4569b commit 1afefb8

File tree

1 file changed

+16
-0
lines changed
  • envoy/extensions/http/injected_credentials/oauth2/v3

1 file changed

+16
-0
lines changed

envoy/extensions/http/injected_credentials/oauth2/v3/oauth2.proto

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ option (xds.annotations.v3.file_status).work_in_progress = true;
2626
// proxied requests.
2727
// Currently, only the Client Credentials Grant flow is supported.
2828
// The access token will be injected into the request headers using the ``Authorization`` header as a bearer token.
29+
// [#next-free-field: 6]
2930
message OAuth2 {
3031
enum AuthType {
3132
// The ``client_id`` and ``client_secret`` will be sent using HTTP Basic authentication scheme.
@@ -53,6 +54,17 @@ message OAuth2 {
5354
AuthType auth_type = 3;
5455
}
5556

57+
// Optional additional parameters to include in the token endpoint request body.
58+
// These parameters will be URL-encoded and added to the request body along with the standard OAuth2 parameters.
59+
// Refer to your authorization server's documentation for supported parameters.
60+
message EndpointParameter {
61+
// Parameter name.
62+
string name = 1 [(validate.rules).string = {min_len: 1}];
63+
64+
// Parameter value.
65+
string value = 2;
66+
}
67+
5668
// Endpoint on the authorization server to retrieve the access token from.
5769
// Refer to [RFC 6749: The OAuth 2.0 Authorization Framework](https://www.rfc-editor.org/rfc/rfc6749#section-3.2) for details.
5870
config.core.v3.HttpUri token_endpoint = 1 [(validate.rules).message = {required: true}];
@@ -73,4 +85,8 @@ message OAuth2 {
7385
// The interval must be at least 1 second.
7486
google.protobuf.Duration token_fetch_retry_interval = 4
7587
[(validate.rules).duration = {gte {seconds: 1}}];
88+
89+
// Optional list of additional parameters to send to the token endpoint.
90+
// These parameters will be URL-encoded and included in the token request body.
91+
repeated EndpointParameter endpoint_params = 5;
7692
}

0 commit comments

Comments
 (0)