You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/guides/secrets.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: Secrets
4
4
5
5
# Exchanging Secret credentials
6
6
7
-
There are 4 types of secrets, `oauth2-client_credentials`, `oauth2-google`, `simple-http`, and `token`. The `credentials` object for each type has different required attributes.
7
+
There are 5 types of secrets, `oauth2-client_credentials`, `oauth2-jwt`, `oauth2-google`, `simple-http`, and `token`. The `credentials` object for each type has different required attributes.
8
8
9
9
## `oauth2-client_credentials` credentials
10
10
@@ -32,6 +32,33 @@ If the exchange is successful, the `Secret` status attribute is set to `succeeed
32
32
33
33
In case of failure, the information is available in the `status_details` attribute from the `meta` object.
34
34
35
+
## `oauth2-jwt` credentials
36
+
37
+
### Credential attributes
38
+
-`iss` - Text - Required - The JWT issuer.
39
+
-`aud` - Text - Required - The JWT audience.
40
+
-`sub` - Text - Optional - The JWT subject.
41
+
-`ttl` - Integer - Required - The JWT ttl. The `exp` claim is computed using this value.
42
+
-`alg` - Text - Required - The algorithm used to sign the JWT. Currently, only `RS256` is supported.
-`token_url` - Text - Optional - The token url of the oauth2 integration. If this value is not included, the JWT will ve used as `access_token`.
45
+
-`private_key_id` - Text - Optional - The private key id. This value will be added to the `kid` JWT header.
46
+
-`private_key` - Text - Required - The private key used to sign to JWT.
47
+
-`refresh_offset` - Integer - Optional - The value, in seconds, used to offset the refresh operation. If not set, an implicit `1800` (30 minutes) will be used.
48
+
-`options` - Object - Optional - Key/Value pairs of options for the oauth2 integration.
49
+
50
+
When an `oauth2-jwt` Secret is created or updated, a JWT is created and signed using the private_key. If `token_url` is present, a `POST` is made to the `token_url` with the assertion parameter and JWT value (and possibly options), according to the `rfc7523` standard.
51
+
If the authorization service responds with `200 OK` and a JSON response body, the body is parsed and `access_token` and `expires_in` are used.
52
+
It is expected that the authorization service response body is compatible with the `oauth2` protocol.
53
+
54
+
If `token_url` is not present, the generated JWT is used as `access_token` and the `ttl` as `expires_in`.
55
+
56
+
If the exchange is successful, the `Secret` status attribute is set to `succeeeded` and `expires_at` and `refresh_at` are set.
57
+
-`expires_at` is the current UTC time + `expires_in`.
58
+
-`refresh_at` is the current UTC time + `expires_in` - `refresh_offset`
59
+
60
+
In case of failure, the information is available in the `status_details` attribute from the `meta` object.
0 commit comments