Add oauth2 client-credentials example (#1044)
authorjavivaz <javier.vazquez.romera@gmail.com>
Wed, 22 Mar 2023 12:11:18 +0000 (13:11 +0100)
committerGitHub <noreply@github.com>
Wed, 22 Mar 2023 12:11:18 +0000 (17:41 +0530)
* Add oauth2 client-credentials example

Add an example for oauth2 config with client-credentials, valid status response codes, token url, etc.

Signed-off-by: javivaz <javier.vazquez.romera@gmail.com>
* Remove commented config

Signed-off-by: Suraj Nath <9503187+electron0zero@users.noreply.github.com>
---------

Signed-off-by: javivaz <javier.vazquez.romera@gmail.com>
Signed-off-by: Suraj Nath <9503187+electron0zero@users.noreply.github.com>
Co-authored-by: Suraj Nath <9503187+electron0zero@users.noreply.github.com>
example.yml

index b9a2fdf86c57755a93e8a51ed1f554988226958c..b7ac278315297087400c22cb3893d42c6e40a418 100644 (file)
@@ -58,6 +58,22 @@ modules:
       basic_auth:
         username: "username"
         password: "mysecret"
+  http_2xx_oauth_client_credentials:
+    prober: http
+    timeout: 5s
+    http:
+      valid_http_versions: ["HTTP/1.1", "HTTP/2"]
+      follow_redirects: true
+      preferred_ip_protocol: "ip4"
+      valid_status_codes:
+        - 200
+        - 201
+      oauth2:
+        client_id: "client_id"
+        client_secret: "client_secret"
+        token_url: "https://api.example.com/token"
+        endpoint_params:
+          grant_type: "client_credentials"
   http_custom_ca_example:
     prober: http
     http: