|
12 | 12 | ## Features |
13 | 13 |
|
14 | 14 | * A simple and intuitive interface for quickly trying out different OAuth 2.0 grant types and client authentication methods |
15 | | -* Supports all modern OAuth 2.0 grant types: authorization code, implicit, password, client credentials, refresh token, JWT bearer |
| 15 | +* Supports all modern OAuth 2.0 grant types: authorization code, implicit, password, client credentials, refresh token, JWT bearer, token exchange |
16 | 16 | * Supports all client authentication methods: client secret basic, client secret post, client secret JWT, private key JWT, TLS client auth |
17 | 17 |
|
18 | 18 | ## Installation |
@@ -59,26 +59,30 @@ oauth2c [issuer url] [flags] |
59 | 59 | The available flags are: |
60 | 60 |
|
61 | 61 | ``` sh |
62 | | - --assertion string claims for jwt bearer assertion |
63 | | - --auth-method string token endpoint authentication method |
64 | | - --client-id string client identifier |
65 | | - --client-secret string client secret |
66 | | - --grant-type string grant type |
67 | | - -h, --help help for oauthc |
68 | | - --insecure allow insecure connections |
69 | | - --no-pkce disable proof key for code exchange (PKCE) |
70 | | - --password string resource owner password credentials grant flow password |
71 | | - --pkce enable proof key for code exchange (PKCE) |
72 | | - --refresh-token string refresh token |
73 | | - --response-mode string response mode |
74 | | - --response-types strings response type |
75 | | - --scopes strings requested scopes |
76 | | - --signing-key string path or url to signing key in jwks format |
77 | | - -s, --silent silent mode |
78 | | - --tls-cert string path to tls cert pem file |
79 | | - --tls-key string path to tls key pem file |
80 | | - --tls-root-ca string path to tls root ca pem file |
81 | | - --username string resource owner password credentials grant flow username |
| 62 | + --actor-token string acting party access token |
| 63 | + --actor-token-type string acting party access token type |
| 64 | + --assertion string claims for jwt bearer assertion |
| 65 | + --auth-method string token endpoint authentication method |
| 66 | + --client-id string client identifier |
| 67 | + --client-secret string client secret |
| 68 | + --grant-type string grant type |
| 69 | + -h, --help help for oauthc |
| 70 | + --insecure allow insecure connections |
| 71 | + --no-pkce disable proof key for code exchange (PKCE) |
| 72 | + --password string resource owner password credentials grant flow password |
| 73 | + --pkce enable proof key for code exchange (PKCE) |
| 74 | + --refresh-token string refresh token |
| 75 | + --response-mode string response mode |
| 76 | + --response-types strings response type |
| 77 | + --scopes strings requested scopes |
| 78 | + --signing-key string path or url to signing key in jwks format |
| 79 | + -s, --silent silent mode |
| 80 | + --subject-token string third party access token |
| 81 | + --subject-token-type string third party access token type |
| 82 | + --tls-cert string path to tls cert pem file |
| 83 | + --tls-key string path to tls key pem file |
| 84 | + --tls-root-ca string path to tls root ca pem file |
| 85 | + --username string resource owner password credentials grant flow username |
82 | 86 | ``` |
83 | 87 |
|
84 | 88 | You will be asked to provide the necessary information, such as the grant type, client authentication method, and any other relevant details (if not already provided). |
@@ -267,6 +271,52 @@ oauth2c https://oauth2c.us.authz.cloudentity.io/oauth2c/demo \ |
267 | 271 |
|
268 | 272 | [Learn more about the jwt bearer flow](https://cloudentity.com/developers/basics/oauth-grant-types/using-jwt-profile-for-authorization-flows/) |
269 | 273 |
|
| 274 | +#### Token exchange |
| 275 | + |
| 276 | +The token exchange OAuth2 grant flow involves the client providing an access token to the OAuth2 server, |
| 277 | +which then returns a new access token. This grant type is typically used when the client and the OAuth2 |
| 278 | +server have a pre-existing trust relationship, such as when the client is a trusted third-party. |
| 279 | + |
| 280 | +``` sh |
| 281 | +oauth2c https://oauth2c.us.authz.cloudentity.io/oauth2c/demo \ |
| 282 | + --client-id cauktionbud6q8ftlqq0 \ |
| 283 | + --client-secret HCwQ5uuUWBRHd04ivjX5Kl0Rz8zxMOekeLtqzki0GPc \ |
| 284 | + --grant-type urn:ietf:params:oauth:grant-type:token-exchange \ |
| 285 | + --auth-method client_secret_basic \ |
| 286 | + --scopes email \ |
| 287 | + --subject-token $SUBJECT_TOKEN \ |
| 288 | + --subject-token-type urn:ietf:params:oauth:token-type:access_token \ |
| 289 | + --actor-token $ACTOR_TOKEN \ |
| 290 | + --actor-token-type urn:ietf:params:oauth:token-type:access_token |
| 291 | +``` |
| 292 | + |
| 293 | +> **Note** In order to use this command, you must first set the SUBJECT_TOKEN and ACTOR_TOKEN environment variables |
| 294 | +> |
| 295 | +> ``` sh |
| 296 | +> export SUBJECT_TOKEN=`oauth2c https://oauth2c.us.authz.cloudentity.io/oauth2c/demo \ |
| 297 | +> --client-id cauktionbud6q8ftlqq0 \ |
| 298 | +> --client-secret HCwQ5uuUWBRHd04ivjX5Kl0Rz8zxMOekeLtqzki0GPc \ |
| 299 | +> --response-types code \ |
| 300 | +> --response-mode query \ |
| 301 | +> --grant-type authorization_code \ |
| 302 | +> --auth-method client_secret_basic \ |
| 303 | +> --scopes openid,email,offline_access \ |
| 304 | +> --no-pkce \ |
| 305 | +> --silent | jq -r .access_token` |
| 306 | +> ``` |
| 307 | +
|
| 308 | +> ``` sh |
| 309 | +> export ACTOR_TOKEN=`oauth2c https://oauth2c.us.authz.cloudentity.io/oauth2c/demo \ |
| 310 | +> --client-id cauktionbud6q8ftlqq0 \ |
| 311 | +> --client-secret HCwQ5uuUWBRHd04ivjX5Kl0Rz8zxMOekeLtqzki0GPc \ |
| 312 | +> --grant-type client_credentials \ |
| 313 | +> --auth-method client_secret_basic \ |
| 314 | +> --scopes introspect_tokens,revoke_tokens \ |
| 315 | +> --silent | jq -r .access_token` |
| 316 | +> ``` |
| 317 | +
|
| 318 | +[Learn more about the token exchange flow](https://cloudentity.com/developers/basics/oauth-grant-types/token-exchange/) |
| 319 | +
|
270 | 320 | ### Auth methods |
271 | 321 |
|
272 | 322 | #### Client Secret Basic |
|
0 commit comments