|
| 1 | +# OAuth Configuration Guide |
| 2 | + |
| 3 | +kminion supports OAUTHBEARER SASL mechanism with two flavors: |
| 4 | + |
| 5 | +1. **Generic OAuth** - Standard OAuth 2.0 client credentials flow |
| 6 | +2. **Adobe IMS OAuth** - Adobe Identity Management System integration |
| 7 | + |
| 8 | +## Generic OAuth Configuration |
| 9 | + |
| 10 | +For standard OAuth 2.0 providers, configure the following: |
| 11 | + |
| 12 | +```yaml |
| 13 | +kafka: |
| 14 | + sasl: |
| 15 | + enabled: true |
| 16 | + mechanism: "OAUTHBEARER" |
| 17 | + oauth: |
| 18 | + # Leave type empty for generic OAuth |
| 19 | + type: "" |
| 20 | + tokenEndpoint: "https://your-oauth-provider.com/oauth/token" |
| 21 | + clientId: "your-client-id" |
| 22 | + clientSecret: "your-client-secret" |
| 23 | + scope: "kafka" |
| 24 | +``` |
| 25 | +
|
| 26 | +### Environment Variables |
| 27 | +
|
| 28 | +```bash |
| 29 | +KAFKA_SASL_ENABLED=true |
| 30 | +KAFKA_SASL_MECHANISM=OAUTHBEARER |
| 31 | +KAFKA_SASL_OAUTH_TYPE="" |
| 32 | +KAFKA_SASL_OAUTH_TOKENENDPOINT=https://your-oauth-provider.com/oauth/token |
| 33 | +KAFKA_SASL_OAUTH_CLIENTID=your-client-id |
| 34 | +KAFKA_SASL_OAUTH_CLIENTSECRET=your-client-secret |
| 35 | +KAFKA_SASL_OAUTH_SCOPE=kafka |
| 36 | +``` |
| 37 | + |
| 38 | +## Adobe IMS OAuth Configuration |
| 39 | + |
| 40 | +For Adobe Identity Management System, configure the following: |
| 41 | + |
| 42 | +```yaml |
| 43 | +kafka: |
| 44 | + sasl: |
| 45 | + enabled: true |
| 46 | + mechanism: "OAUTHBEARER" |
| 47 | + oauth: |
| 48 | + type: "AdobeIMS" |
| 49 | + tokenEndpoint: "https://ims-na1.adobelogin.com" |
| 50 | + clientId: "your-ims-client-id" |
| 51 | + clientSecret: "your-ims-client-secret" |
| 52 | + additional: |
| 53 | + clientCode: "your-ims-code" |
| 54 | +``` |
| 55 | +
|
| 56 | +### Environment Variables |
| 57 | +
|
| 58 | +```bash |
| 59 | +KAFKA_SASL_ENABLED=true |
| 60 | +KAFKA_SASL_MECHANISM=OAUTHBEARER |
| 61 | +KAFKA_SASL_OAUTH_TYPE=AdobeIMS |
| 62 | +KAFKA_SASL_OAUTH_TOKENENDPOINT=https://ims-na1.adobelogin.com |
| 63 | +KAFKA_SASL_OAUTH_CLIENTID=your-ims-client-id |
| 64 | +KAFKA_SASL_OAUTH_CLIENTSECRET=your-ims-client-secret |
| 65 | +KAFKA_SASL_OAUTH_ADDITIONAL_CLIENTCODE=your-ims-code |
| 66 | +``` |
| 67 | + |
| 68 | +## How It Works |
| 69 | + |
| 70 | +### Generic OAuth Flow |
| 71 | + |
| 72 | +1. kminion uses the client credentials grant type |
| 73 | +2. Sends a POST request to the token endpoint with client ID and secret |
| 74 | +3. Receives an access token |
| 75 | +4. Uses the token for Kafka authentication |
| 76 | + |
| 77 | +### Adobe IMS Flow |
| 78 | + |
| 79 | +1. kminion uses the Adobe IMS Go SDK (`github.com/adobe/ims-go`) |
| 80 | +2. Creates an IMS client with the configured endpoint |
| 81 | +3. Requests a token using the IMS-specific authentication flow |
| 82 | +4. Uses the access token for Kafka authentication |
| 83 | + |
| 84 | +## Switching Between Providers |
| 85 | + |
| 86 | +The `type` field determines which OAuth provider to use: |
| 87 | + |
| 88 | +- **Empty or omitted**: Uses generic OAuth with `tokenEndpoint`, `clientId`, `clientSecret`, and `scope` |
| 89 | +- **"AdobeIMS"**: Uses Adobe IMS with `tokenEndpoint`, `clientId`, `clientSecret`, and `additional.clientCode` |
| 90 | + |
| 91 | +### Field Reuse |
| 92 | + |
| 93 | +Both generic OAuth and Adobe IMS share common fields: |
| 94 | +- `tokenEndpoint`: OAuth token endpoint URL (for Adobe IMS, this is the IMS endpoint) |
| 95 | +- `clientId`: OAuth client ID |
| 96 | +- `clientSecret`: OAuth client secret |
| 97 | + |
| 98 | +Provider-specific fields go in the `additional` block: |
| 99 | +- For Adobe IMS: `clientCode` (authorization code) |
| 100 | + |
| 101 | +## Validation |
| 102 | + |
| 103 | +- **Generic OAuth**: Validates that `tokenEndpoint`, `clientId`, and `clientSecret` are provided |
| 104 | +- **Adobe IMS**: Validation happens during client creation when connecting to Kafka |
| 105 | + |
| 106 | +## Dependencies |
| 107 | + |
| 108 | +- Generic OAuth: Built-in HTTP client |
| 109 | +- Adobe IMS: `github.com/adobe/ims-go` v0.16.1+ |
| 110 | + |
0 commit comments