cloudentity / oauth2c

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

Add support for tls callback #99

Closed mbilski closed 10 months ago

mbilski commented 10 months ago

This adds support for using TLS in callback redirect URL as requested in #98

Example:

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 \
  --redirect-url https://localhost:9876/callback \
  --callback-tls-cert https://raw.githubusercontent.com/cloudentity/oauth2c/master/data/cert.pem \
  --callback-tls-key https://raw.githubusercontent.com/cloudentity/oauth2c/master/data/key.pem

OAuth2c automatically detects the need for TLS if the redirect-url contains https schema. In this case, it is required to provide callback-tls-cert and callback-tls-key