OAuth2 憑證 (proto)

此擴充功能的完整名稱為 envoy.http.injected_credentials.oauth2

注意

此擴充功能目前可用,但尚未經過大量的正式環境驗證,請謹慎使用。

此擴充功能的安全狀態未知,僅應在下游和上游都受信任的部署中使用。

提示

此擴充功能擴展並可與下列擴充功能類別一起使用

此擴充功能必須使用下列其中一種型別 URL 進行組態設定

警告

此 API 功能目前仍在開發中。標示為開發中的 API 功能不被視為穩定,不受威脅模型涵蓋,不受安全團隊支援,並且可能發生重大變更。請勿在不了解以上各點的情況下使用此功能。

extensions.http.injected_credentials.oauth2.v3.OAuth2

[extensions.http.injected_credentials.oauth2.v3.OAuth2 proto]

OAuth2 擴充功能可用於從授權伺服器擷取 OAuth2 存取權杖,並將其注入至代理的請求中。目前僅支援客戶端憑證授權流程。存取權杖將以持有人權杖的形式,使用 Authorization 標頭注入至請求標頭中。

{
  "token_endpoint": {...},
  "scopes": [],
  "client_credentials": {...},
  "token_fetch_retry_interval": {...}
}
token_endpoint

(config.core.v3.HttpUri必填) 授權伺服器上的端點,用於從中擷取存取權杖。詳細資訊請參閱 [RFC 6749:OAuth 2.0 授權框架](https://www.rfc-editor.org/rfc/rfc6749#section-3.2)。

scopes

(重複 string) 要在授權請求中聲明的 OAuth 範圍的選用清單。詳細資訊請參閱 [RFC 6749:OAuth 2.0 授權框架](https://www.rfc-editor.org/rfc/rfc6749#section-4.4.2)。

client_credentials

(extensions.http.injected_credentials.oauth2.v3.OAuth2.ClientCredentials必填) 客戶端憑證授權。詳細資訊請參閱 [RFC 6749:OAuth 2.0 授權框架](https://www.rfc-editor.org/rfc/rfc6749#section-4.4)。

token_fetch_retry_interval

(Duration) 從身分提供者擷取權杖的兩次連續重試之間的間隔。預設值為 2 秒。間隔必須至少為 1 秒。

extensions.http.injected_credentials.oauth2.v3.OAuth2.ClientCredentials

[extensions.http.injected_credentials.oauth2.v3.OAuth2.ClientCredentials proto]

用於向授權伺服器驗證客戶端的憑證。詳細資訊請參閱 [RFC 6749:OAuth 2.0 授權框架](https://www.rfc-editor.org/rfc/rfc6749#section-2.3)。

{
  "client_id": ...,
  "client_secret": {...},
  "auth_type": ...
}
client_id

(string必填) 客戶端 ID。詳細資訊請參閱 [RFC 6749:OAuth 2.0 授權框架](https://www.rfc-editor.org/rfc/rfc6749#section-2.3.1)。

client_secret

(extensions.transport_sockets.tls.v3.SdsSecretConfig必填) 客戶端密碼。詳細資訊請參閱 [RFC 6749:OAuth 2.0 授權框架](https://www.rfc-editor.org/rfc/rfc6749#section-2.3.1)。

auth_type

(extensions.http.injected_credentials.oauth2.v3.OAuth2.AuthType) 向授權伺服器傳送憑證時要使用的方法。詳細資訊請參閱 [RFC 6749:OAuth 2.0 授權框架](https://www.rfc-editor.org/rfc/rfc6749#section-2.3.1)。

列舉 extensions.http.injected_credentials.oauth2.v3.OAuth2.AuthType

[extensions.http.injected_credentials.oauth2.v3.OAuth2.AuthType proto]

BASIC_AUTH

(預設)client_idclient_secret 將使用 HTTP 基本驗證方案傳送。

URL_ENCODED_BODY

client_idclient_secret 將在 URL 編碼的請求內文中傳送。只有在授權伺服器不支援基本驗證時才應使用此類型。