jfrog / terraform-provider-artifactory

Terraform provider to manage JFrog Artifactory
https://jfrog.com/artifactory
Apache License 2.0
271 stars 104 forks source link

Scope token are not valid across instances #536

Closed Leletir closed 1 year ago

Leletir commented 2 years ago

Describe the bug I have 3 Artifactory instances all in different regions (A, B, and C),

I've created a scope token for a user via artifactory_scoped_token resource. The problem is when I'm using this token in the 3 instances, it's only working on one, the one where it has been created, despite the 3 instances being part of a circle of trust. According to the documentation (https://www.jfrog.com/confluence/display/JFROG/Access+Tokens#AccessTokens-CircleofTrust(Cross-InstanceAuthentication) the token should be working across all the instances.

Here is the TF snippet:

resource "artifactory_unmanaged_user" "ci--user-service-account" {
  name     = "toto"
  email    = "toto@gmail.com"
  disable_ui_access = true
}

resource "artifactory_scoped_token" "ci-team-group-scoped-token-user" {
  username = artifactory_unmanaged_user.ci-team-user-service-account.name
  scopes = ["applied-permissions/user"]
  expires_in = 0
}

To replicate the issue:

podman login instanceA
=> Login Succeeded
podman login instanceB
=> Error: error logging into "instanceB": invalid username/password
podman login instanceC
=> Error: error logging into "instanceC": invalid username/password

Context:

Expected behavior We should be able to log in using the same token across all the instances.

Do you know if I have missed something ? Thanks in advance.

alexhung commented 2 years ago

@Leletir Thanks for the report. We'll take a look at this soon.

danielmkn commented 1 year ago

@Leletir, there is a bug in Artifactory (7.41.12 and below), that will be resolved soon. Once it's fixed, we will verify the way access tokens are created in Terraform Provider and make changes, if necessary.
Closing this ticket, it's not a Provider issue.

Leletir commented 1 year ago

Hi @danielmkn, thanks for the answer. Do you have a link to the bug? (Like a JIRA ticket)

danielmkn commented 1 year ago

Sorry, @Leletir, they are in internal Jira, you won't be able to open them. It's estimated to be fixed in Q4.