Currently, kafka-auth is the only supported profile provided by the platform for Kafka authentication.
Understanding SPRING_PROFILES_ACTIVE
SPRING_PROFILES_ACTIVE is an environment variable used by Spring Boot to determine which configuration profiles should be active at runtime.
Key characteristics
- Multiple profiles: Can contain one or more profile names, separated by commas
- Example:
SPRING_PROFILES_ACTIVE=dev,kafka-auth
- Example:
- Environment-specific behavior: Profiles allow different sets of configuration to be loaded depending on the environment or required feature set
- Special kafka-auth profile: Activates Kafka authentication across services
Configuration details
When thekafka-auth profile is enabled, the following Spring Kafka properties are automatically applied:
Configuration properties explained
Required environment variables
The Kafka authentication profile uses environment variables to configure OAuth parameters dynamically. These variables should be set in the runtime environment for each microservice.Benefits
Enabling the Kafka authentication profile provides several advantages:- Centralized enablement: Activates OAuth-based Kafka authentication consistently across services.
- Configurable via environment variables: No hardcoding of sensitive data in app configuration.
- Simple activation: Controlled entirely by the
SPRING_PROFILES_ACTIVEvariable.
Notes and limitations
- Only the kafka-auth profile is currently supported for Kafka authentication.
- The profile enforces SASL/OAUTHBEARER with plaintext transport. Secure networking (for example, VPN, mTLS) should be ensured where required.

