-
Notifications
You must be signed in to change notification settings - Fork 1.3k
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Uri credentials not working #1621
Comments
There's other logging that might be useful (the exception is not). |
@spencergibb I tried it both ways (in the uri and broken out) and the Fetching looks the same: 2020-05-13 19:04:36.416 INFO 584724 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : https://config01.mysoftware.com:9345 Looking at the code, you strip the credentials off the uri anyways, so that makes sense. |
Care to set a breakpoint in |
@spencergibb Ah, I found the issue... it's an edge case :). My password happens to contain an @ sign in it, so in the properties file, I need to url encode it as %40: spring.cloud.config.uri=https://user:password%40@config01.mysoftware.com:9345 You are missing the url decoding step on the username and password when pulling from the Url, so it's getting added to the authorization header as "password%40" instead of "password@". In the broken out username and password, encoding isn't required, that's why it works there. If I fix the password value in the debugger, it works. I actually have the same password on Eureka and that handles the url decoding properly. |
Dependency:
org.springframework.cloud:spring-cloud-starter-config:2.2.2.RELEASE
According to the documentation, Uri credentials should work.
bootstrap.properties (FAILS)
spring.cloud.config.uri=https://user:password@config01.mysoftware.com:9345
bootstrap.properties (WORKS)
spring.cloud.config.uri=https://config01.mysoftware.com:9345
spring.cloud.config.username=user
spring.cloud.config.password=password
Seems to be specific to Config since I use Uri credentials for Eureka and it works fine. The Uri is correct and verified since going to https://user:password@config01.mysoftware.com:9345/test/Dev in the browser returns the correct json.
In the case where it fails, the exception is:
The text was updated successfully, but these errors were encountered: