cloudentity / oauth2c

User-friendly OAuth2 CLI
https://cloudentity.github.io/oauth2c/
Apache License 2.0
768 stars 29 forks source link

Print debug info to stderr #77

Closed mbilski closed 1 year ago

mbilski commented 1 year ago

Print all debug info to stderr and always print the result as raw json to stdout

Solves #76

oauth2c on ξ‚  feature/stderr [$] via 🐹 v1.21.0
❯ go run . https://oauth2c.us.authz.cloudentity.io/oauth2c/demo \
  --client-id cauktionbud6q8ftlqq0 \
  --client-secret HCwQ5uuUWBRHd04ivjX5Kl0Rz8zxMOekeLtqzki0GPc \
  --response-types code \
  --response-mode query \
  --grant-type authorization_code \
  --auth-method client_secret_basic \
  --scopes openid,email,offline_access > stdout 2> stderr

oauth2c on ξ‚  feature/stderr [$?] via 🐹 v1.21.0 took 3s
❯ cat stdout
{"access_token":"eyJhbGciOiJSUzI1NiIsImtpZCI6IjE3NDYyMTE3MzM2Mjc1NzU0MzM1MzIzOTQwMjgzMjA1Mjk2MzM5NyIsInR5cCI6IkpXVCJ9.eyJhY3IiOiIwIiwiYWlkIjoiZGVtbyIsImFtciI6WyJwd2QiLCJtZmEiXSwiYXVkIjpbImNhdWt0aW9uYnVkNnE4ZnRscXEwIiwic3BpZmZlOi8vb2F1dGgyYy51cy5hdXRoei5jbG91ZGVudGl0eS5pby9vYXV0aDJjL2RlbW8vZGVtby1wcm9maWxlIl0sImVtYWlsIjoibWF0ZXVzei5iaWxza2lAZ21haWwuY29tIiwiZXhwIjoxNjk1OTk1ODI4LCJpYXQiOjE2OTU5OTIyMjgsImlkcCI6ImdpdGh1Yl9lbWJlZGRlZCIsImlzcyI6Imh0dHBzOi8vb2F1dGgyYy51cy5hdXRoei5jbG91ZGVudGl0eS5pby9vYXV0aDJjL2RlbW8iLCJqdGkiOiI2NDZkOTIwZi1kZDMyLTQyYWYtOGJiMC0xZjJmOTRlNmZiYjAiLCJuYmYiOjE2OTU5OTIyMjgsInNjcCI6WyJlbWFpbCIsIm9mZmxpbmVfYWNjZXNzIiwib3BlbmlkIl0s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iwic3ViIjoiMGZmM2Y4N2NlNzE5YWQyMmFmZjNjMDQwN2EyNWM4N2MzZDhjMmZlN2Y3NDhlYWQ3OTkwZjI2ZDM3NzE4YTg1NiIsInRpZCI6Im9hdXRoMmMifQ.d4-hxLfVOx-lvWkGHcKnbHw236_t4AAsO50Da7xAWCzOjbw4FMAxZJ5AU3mWdXsob-0_JU88NRvahAgTkdx96oVmBi7KAoPpnn_1kamUhsCxJzaGcXUZSz4jNWV7idOZS3xtCNLD398AL_PhtMpUnl1qEeQJej6QxN4I396baLBqQ-xQVw_okytMnGCbqyuwEqyP7iChmaY5pLO2bsfbpVEZtbQ5pCinKX8_cwTfvYsyZsPYEQFcjQxIZsOKu8NcJ3V2HrX_e-hXvjIk6X5sHi8iqB7SAnzsnawJJLPwZdjmEeMald20rsKCsdP9NQasWpOZSqRxlkpgo0X-HywnDg","refresh_token":"qu7J2SnfJdv1shdIFIcKVlBv2H8qlp8KIy9C3QCXzpE.aqKCTKsx2jo0M5F0Sv5ArK9k4GFzQ2zd-Yc14Oix-nA","scope":"email offline_access openid","token_type":"bearer"}

oauth2c on ξ‚  feature/stderr [$?] via 🐹 v1.21.0
❯ cat stderr
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
| Issuer URL     | https://oauth2c.us.authz.cloudentity.io/oauth2c/demo |
| Grant type     | authorization_code                                   |
| Auth method    | client_secret_basic                                  |
| Scopes         | openid, email, offline_access                        |
| Response types | code                                                 |
| Response mode  | query                                                |
| PKCE           | false                                                |
| Client ID      | cauktionbud6q8ftlqq0                                 |
| Client secret  | HCwQ5uuUWBRHd04ivjX5Kl0Rz8zxMOekeLtqzki0GPc          |
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

                            Authorization Code Flow

# Request authorization

GET https://oauth2c.us.authz.cloudentity.io/oauth2c/demo/oauth2/authorize
Query params:
  scope: openid email offline_access
  state: oKbYHnxNgmCbuooYurGe7S
  client_id: cauktionbud6q8ftlqq0
  nonce: ngdHKtzTiUrGqVY4Sgkaic
  redirect_uri: http://localhost:9876/callback
  response_mode: query
  response_type: code

Open the following URL:

https://oauth2c.us.authz.cloudentity.io/oauth2c/demo/oauth2/authorize?client_id=cauktionbud6q8ftlqq0&nonce=ngdHKtzTiUrGqVY4Sgkaic&redirect_uri=http%3A%2F%2Flocalhost%3A9876%2Fcallback&response_mode=query&response_type=code&scope=openid+email+offline_access&state=oKbYHnxNgmCbuooYurGe7S

GET /callback
Query params:
  code: mw4gr4BveOuO_hoOhfm9ZmuYC-tzs4Q3LAndGtMlMHQ.vjelJQRfg7rblL4Mql0MDQEzYI-TmnGBmoaUA3I_T9s
  state: oKbYHnxNgmCbuooYurGe7S

 SUCCESS  Obtained authorization code

# Exchange authorization code for token

β”Œβ”€ Client Secret Basic ──────────────────────────────────────┐
| Authorization = Basic BASE64-ENCODE(ClientID:ClientSecret) |
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

POST https://oauth2c.us.authz.cloudentity.io/oauth2c/demo/oauth2/token
Headers:
  Authorization: Basic Y2F1a3Rpb25idWQ2cThmdGxxcTA6SEN3UTV1dVVXQlJIZDA0aXZqWDVLbDBSejh6eE1PZWtlTHRxemtpMEdQYw==
  Content-Type: application/x-www-form-urlencoded
Form post:
  code: mw4gr4BveOuO_hoOhfm9ZmuYC-tzs4Q3LAndGtMlMHQ.vjelJQRfg7rblL4Mql0MDQEzYI-TmnGBmoaUA3I_T9s
  grant_type: authorization_code
  redirect_uri: http://localhost:9876/callback
Response:
{
  "access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjE3NDYyMTE3MzM2Mjc1NzU0MzM1MzIzOTQwMjgzMjA1Mjk2MzM5NyIsInR5cCI6IkpXVCJ9.eyJhY3IiOiIwIiwiYWlkIjoiZGVtbyIsImFtciI6WyJwd2QiLCJtZmEiXSwiYXVkIjpbImNhdWt0aW9uYnVkNnE4ZnRscXEwIiwic3BpZmZlOi8vb2F1dGgyYy51cy5hdXRoei5jbG91ZGVudGl0eS5pby9vYXV0aDJjL2RlbW8vZGVtby1wcm9maWxlIl0sImVtYWlsIjoibWF0ZXVzei5iaWxza2lAZ21haWwuY29tIiwiZXhwIjoxNjk1OTk1ODI4LCJpYXQiOjE2OTU5OTIyMjgsImlkcCI6ImdpdGh1Yl9lbWJlZGRlZCIsImlzcyI6Imh0dHBzOi8vb2F1dGgyYy51cy5hdXRoei5jbG91ZGVudGl0eS5pby9vYXV0aDJjL2RlbW8iLCJqdGkiOiI2NDZkOTIwZi1kZDMyLTQyYWYtOGJiMC0xZjJmOTRlNmZiYjAiLCJuYmYiOjE2OTU5OTIyMjgsInNjcCI6WyJlbWFpbCIsIm9mZmxpbmVfYWNjZXNzIiwib3BlbmlkIl0sInN0IjoicHVibGljIiwic3ViIjoiMGZmM2Y4N2NlNzE5YWQyMmFmZjNjMDQwN2EyNWM4N2MzZDhjMmZlN2Y3NDhlYWQ3OTkwZjI2ZDM3NzE4YTg1NiIsInRpZCI6Im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mMifQ.d4-hxLfVOx-lvWkGHcKnbHw236_t4AAsO50Da7xAWCzOjbw4FMAxZJ5AU3mWdXsob-0_JU88NRvahAgTkdx96oVmBi7KAoPpnn_1kamUhsCxJzaGcXUZSz4jNWV7idOZS3xtCNLD398AL_PhtMpUnl1qEeQJej6QxN4I396baLBqQ-xQVw_okytMnGCbqyuwEqyP7iChmaY5pLO2bsfbpVEZtbQ5pCinKX8_cwTfvYsyZsPYEQFcjQxIZsOKu8NcJ3V2HrX_e-hXvjIk6X5sHi8iqB7SAnzsnawJJLPwZdjmEeMald20rsKCsdP9NQasWpOZSqRxlkpgo0X-HywnDg",
  "refresh_token": "qu7J2SnfJdv1shdIFIcKVlBv2H8qlp8KIy9C3QCXzpE.aqKCTKsx2jo0M5F0Sv5ArK9k4GFzQ2zd-Yc14Oix-nA",
  "scope": "email offline_access openid",
  "token_type": "bearer"
}
Access token:
{
  "acr": "0",
  "aid": "demo",
  "amr": ["pwd", "mfa"],
  "aud": [
    "cauktionbud6q8ftlqq0",
    "spiffe://oauth2c.us.authz.cloudentity.io/oauth2c/demo/demo-profile"
  ],
  "email": "mateusz.bilski@gmail.com",
  "exp": 1695995828,
  "iat": 1695992228,
  "idp": "github_embedded",
  "iss": "https://oauth2c.us.authz.cloudentity.io/oauth2c/demo",
  "jti": "646d920f-dd32-42af-8bb0-1f2f94e6fbb0",
  "nbf": 1695992228,
  "scp": ["email", "offline_access", "openid"],
  "st": "public",
  "sub": "0ff3f87ce719ad22aff3c0407a25c87c3d8c2fe7f748ead7990f26d37718a856",
  "tid": "oauth2c"
}
ID token:
{
  "acr": "0",
  "aid": "demo",
  "amr": ["pwd", "mfa"],
  "at_hash": "YOuUfh08w4KyjYYZb1VoHw",
  "aud": "cauktionbud6q8ftlqq0",
  "auth_time": 1695992122,
  "exp": 1695995828,
  "iat": 1695992228,
  "idp": "github_embedded",
  "idpm": "static",
  "iss": "https://oauth2c.us.authz.cloudentity.io/oauth2c/demo",
  "jti": "a22d5f7b-7772-4a6e-a95b-15300260748d",
  "nonce": "ngdHKtzTiUrGqVY4Sgkaic",
  "sub": "0ff3f87ce719ad22aff3c0407a25c87c3d8c2fe7f748ead7990f26d37718a856",
  "tid": "oauth2c"
}

 SUCCESS  Exchanged authorization code for access token
oauth2c on ξ‚  feature/stderr [$?] via 🐹 v1.21.0
❯ export TOKEN=`go run . https://oauth2c.us.authz.cloudentity.io/oauth2c/demo \
  --client-id cauktionbud6q8ftlqq0 \
  --client-secret HCwQ5uuUWBRHd04ivjX5Kl0Rz8zxMOekeLtqzki0GPc \
  --response-types code \
  --response-mode query \
  --grant-type authorization_code \
  --auth-method client_secret_basic \
  --scopes openid,email,offline_access | jq -r .access_token`
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
| Issuer URL     | https://oauth2c.us.authz.cloudentity.io/oauth2c/demo |
| Grant type     | authorization_code                                   |
| Auth method    | client_secret_basic                                  |
| Scopes         | openid, email, offline_access                        |
| Response types | code                                                 |
| Response mode  | query                                                |
| PKCE           | false                                                |
| Client ID      | cauktionbud6q8ftlqq0                                 |
| Client secret  | HCwQ5uuUWBRHd04ivjX5Kl0Rz8zxMOekeLtqzki0GPc          |
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

                            Authorization Code Flow

# Request authorization

GET https://oauth2c.us.authz.cloudentity.io/oauth2c/demo/oauth2/authorize
Query params:
  client_id: cauktionbud6q8ftlqq0
  nonce: jeSQyXEaA5si6V85c54vPS
  redirect_uri: http://localhost:9876/callback
  response_mode: query
  response_type: code
  scope: openid email offline_access
  state: ddFiva6Cv96k8GiGmCi2yv

Open the following URL:

https://oauth2c.us.authz.cloudentity.io/oauth2c/demo/oauth2/authorize?client_id=cauktionbud6q8ftlqq0&nonce=jeSQyXEaA5si6V85c54vPS&redirect_uri=http%3A%2F%2Flocalhost%3A9876%2Fcallback&response_mode=query&response_type=code&scope=openid+email+offline_access&state=ddFiva6Cv96k8GiGmCi2yv

GET /callback
Query params:
  code: ulRWh5K3bAt5hUv9iKHKEs9_AEffIpKwa1d22IZ_q6U.X4zV07MaLKshHCAtqWrxz7mtZqjdsN2mNPq8EgIlzNI
  state: ddFiva6Cv96k8GiGmCi2yv

 SUCCESS  Obtained authorization code

# Exchange authorization code for token

β”Œβ”€ Client Secret Basic ──────────────────────────────────────┐
| Authorization = Basic BASE64-ENCODE(ClientID:ClientSecret) |
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

POST https://oauth2c.us.authz.cloudentity.io/oauth2c/demo/oauth2/token
Headers:
  Authorization: Basic Y2F1a3Rpb25idWQ2cThmdGxxcTA6SEN3UTV1dVVXQlJIZDA0aXZqWDVLbDBSejh6eE1PZWtlTHRxemtpMEdQYw==
  Content-Type: application/x-www-form-urlencoded
Form post:
  code: ulRWh5K3bAt5hUv9iKHKEs9_AEffIpKwa1d22IZ_q6U.X4zV07MaLKshHCAtqWrxz7mtZqjdsN2mNPq8EgIlzNI
  grant_type: authorization_code
  redir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MuX136sbk8snUyKASoxKqCJNx--bbQzwqPKdEJv64DuTNIF0cjO2CQz7mrxs3f6HtUT-_xc2PDDm31OKWA",
  "refresh_token": "6FeAOx6RBhd5lhsxNbO6_iC5MUuQldfZ0jNA5UuQI1c.DQhadw64UXoRf3bnzctJLjLW8EO-MOaoU3ErNW2KZzc",
  "scope": "email offline_access openid",
  "token_type": "bearer"
}
Access token:
{
  "acr": "0",
  "aid": "demo",
  "amr": ["pwd", "mfa"],
  "aud": [
    "cauktionbud6q8ftlqq0",
    "spiffe://oauth2c.us.authz.cloudentity.io/oauth2c/demo/demo-profile"
  ],
  "email": "mateusz.bilski@gmail.com",
  "exp": 1695995991,
  "iat": 1695992390,
  "idp": "github_embedded",
  "iss": "https://oauth2c.us.authz.cloudentity.io/oauth2c/demo",
  "jti": "c8684011-1177-456f-a793-e9322dfddeec",
  "nbf": 1695992390,
  "scp": ["email", "offline_access", "openid"],
  "st": "public",
  "sub": "0ff3f87ce719ad22aff3c0407a25c87c3d8c2fe7f748ead7990f26d37718a856",
  "tid": "oauth2c"
}
ID token:
{
  "acr": "0",
  "aid": "demo",
  "amr": ["pwd", "mfa"],
  "at_hash": "vCfx0Gb1kDxQB1SXZEgibg",
  "aud": "cauktionbud6q8ftlqq0",
  "auth_time": 1695992122,
  "exp": 1695995990,
  "iat": 1695992390,
  "idp": "github_embedded",
  "idpm": "static",
  "iss": "https://oauth2c.us.authz.cloudentity.io/oauth2c/demo",
  "jti": "404dfd80-6b94-431d-9b91-c19bc35a0968",
  "nonce": "jeSQyXEaA5si6V85c54vPS",
  "sub": "0ff3f87ce719ad22aff3c0407a25c87c3d8c2fe7f748ead7990f26d37718a856",
  "tid": "oauth2c"
}

 SUCCESS  Exchanged authorization code for access token

oauth2c on ξ‚  feature/stderr [$?] via 🐹 v1.21.0 took 2s
❯ echo $TOKEN
eyJhbGciOiJSUzI1NiIsImtpZCI6IjE3NDYyMTE3MzM2Mjc1NzU0MzM1MzIzOTQwMjgzMjA1Mjk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