Closed vrvaderom closed 2 years ago
Hi @vrvaderom! Thanks for reporting this.
Could you share what content you see in the discovery document for this host, at https://artifactory.dev.local:8443/.well-known/terraform.json
? The login.v1
section of that document is what Terraform is reacting to when building this URL. I'd like to see which URLs your server is advertising to try to understand why the port number is being lost.
Thanks!
Hi
Here is the content of https://artifactory.dev.local:8443/.well-known/terraform.json
{
"modules.v1" : "https://artifactory.dev.local:8443/artifactory/api/terraform/v1/modules/",
"state.v2" : "https://artifactory.dev.local:8443/artifactory/api/terraform/remote/v2",
"tfe.v2" : "https://artifactory.dev.local:8443/artifactory/api/terraform/remote/v2",
"tfe.v2.1" : "https://artifactory.dev.local:8443/artifactory/api/terraform/remote/v2",
"tfe.v2.2" : "https://artifactory.dev.local:8443/artifactory/api/terraform/remote/v2",
"login.v1" : {
"client" : "terraform-cli",
"authz" : "https://artifactory.dev.local/ui/terraform/oauth2/authorize",
"token" : "https://artifactory.dev.local:8443/artifactory/api/oauth2/token",
"grant_types" : [ "authz_code" ]
}
}
Indeed for some reason the authz is ignoring the custom port.
A bug in the Artifactory implementation of the terraform remote backend?
Hi @vrvaderom ! Thanks for sharing that.
Indeed, it seems like there is a small bug in the software that is generating this document, where for that particular URL it is not including your nonstandard port number.
I expect that correcting that URL will allow terraform login
to complete the OAuth flow.
Manually correcting the URL does indeed allow completing the auth flow. I will open an issue with Jfrog Artifactory support about this.
You can close this. Thank you!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Terraform Version
Terraform Configuration Files
Debug Output
Expected Behavior
Browser should open with the backend oauth login url for the host https://artifactory.dev.local:8443
Actual Behavior
Browser opens and browses to https://artifactory.dev.local instead (default HTTPS port)
Steps to Reproduce
Additional Context
This was tested with remote backend hosted on artifactory, but I expect the mechanism to be the same for all remote backends.
References
No response