-
Notifications
You must be signed in to change notification settings - Fork 67
Unable to use environment variables when configuring params for AuthenticationOAuth2 #575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @mnapoleon , Thanks for the report. Yes, prior to moving the auto-configuration into the Spring Boot project (in the
Thanks |
@onobc - Thanks for the information. Unforunately when using the environment variable names with the exact casing as you describe the camel casing is still lost in the properties map. I was able to find a work around I think. And then referencing the env vars in my application.yaml file like this
Seems to work. |
Ha. Fair enough @mnapoleon. This was assuming that the exact casing would work. I also landed on the same workaround as you (mapping the env var in the yml) but you beat me to the issue. Thanks. I will get this added to the SB docs as a workaround for now. |
Resolved via 6b6f0be |
Code Versions
Spring Boot - 3.2.2
Spring Pulsar - 1.0.2
When starting up an application that using application.yaml to provide the authentication params there are no issues and PulsarTemplate is created.
Example of pulsar client section of application.yaml
When switching to using environment variables like this the application does not start.
SPRING_PULSAR_CLIENT_AUTHENTICATION_PARAM_AUDIENCE=urn:sn:pulsar:o-vox1v:dev SPRING_PULSAR_CLIENT_AUTHENTICATION_PARAM_ISSUERURL=https://auth.streamnative.cloud/ SPRING_PULSAR_CLIENT_AUTHENTICATION_PARAM_PRIVATEKEY= data:application/json;base64,ewo<cutoff to avoid secrets
After some debugging I found that the code configuring the PulsarClient is excepting properties named
issuerUrl
andprivateKey
(camelCase). But when the values are supplied via environment variables the properties in the property map are namedissuerurl
andprivatekey
(no camelCase).The application does not start and the exception is
org.apache.pulsar.client.api.PulsarClientException$UnsupportedAuthenticationException: org.apache.pulsar.client.api.PulsarClientException$UnsupportedAuthenticationException: java.lang.IllegalArgumentException: Required configuration parameter: issuerUrl
I am wondering if this a bug or expected behavior.
The text was updated successfully, but these errors were encountered: