oktadev / okta-maven-plugin

Apache License 2.0
1 stars 6 forks source link

Remove back slash from issuer that's added to application.properties #5

Open mraible opened 4 years ago

mraible commented 4 years ago

I discovered this while editing Jimena's Spring Session post. If you copy the values from application.properties to a Docker Compose .env file, it fails on startup.

Caused by: java.net.URISyntaxException: Illegal character in scheme name at index 5: https\://dev-133320.okta.com/oauth2/default
mraible commented 3 years ago

@bdemers This still happens with the Okta CLI. Is it possible to fix it or should I just remove the backslash from our CLI include? Search for \ in this file to see where it's used.

bdemers commented 3 years ago

It does, it's caused by using Properties.store(...)

https://docs.oracle.com/javase/7/docs/api/java/util/Properties.html#store%28java.io.Writer,%20java.lang.String%29

The key and element characters #, !, =, and : are written with a preceding backslash to ensure that they are properly loaded.

However, it does seem we could hack around this, by doing something like: https://stackoverflow.com/questions/10699055/how-do-you-escape-colon-in-properties-file

I don't think I've ever had a problem loading a property value that has contained a colon, so maybe it's worth trying it out?

Thoughts?

mraible commented 3 years ago

I think we should do something to fix it. If people copy the URL into some other file with the \, it causes issues.

bdemers commented 3 years ago

I think you have convinced me 😄