Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

auth0_client_grant does not accept empty scopes #159

Closed
stefangreim opened this issue Jan 14, 2020 · 5 comments · Fixed by #162
Closed

auth0_client_grant does not accept empty scopes #159

stefangreim opened this issue Jan 14, 2020 · 5 comments · Fixed by #162

Comments

@stefangreim
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.12.19

Affected Resource(s)

  • auth0_client_grant

Terraform Configuration Files

resource "auth0_client_grant" "backend" {
  client_id = auth0_client.backend.id
  audience  = auth0_resource_server.backend.identifier
  scope     = []
}

Debug Output

Not that long, therefore no gist. :)

auth0_client_grant.backend: Creating...

Error: 400 Bad Request: Payload validation error: 'Expected type array but found type null' on property scope (Scopes allowed for this client grant).

  on auth0.tf line 170, in resource "auth0_client_grant" "backend":
 170: resource "auth0_client_grant" "backend" {

Expected Behavior

Provider/API should accept empty list.

Actual Behavior

Terraform throws the error above.

Steps to Reproduce

  1. Use the HCL code above and insert valid values for client_id and audience. For scope only a empty list.
  2. terraform apply

Important Factoids

None

References

@alexkappa
Copy link
Owner

@stefangreim, which version of this provider are you using? I believe this issue has been resolved. I've added a test case to client grants and I can submit empty scopes normally.

@stefangreim
Copy link
Author

@alexkappa v0.4.2
I found out the following: To create the client_grant, I have to use a non-empty scope. After the client_grant has been created, I can do an update with scope = []. So, create doesn't work, update works.
I checked when the last change in the code was done and the last version was built. I assumed that this change was already included.

@scottx611x
Copy link
Contributor

scottx611x commented Jan 15, 2020

I can confirm that a terraform import of an auth0_client_grant with scope = [] works as expected, and can also corroborate the behavior that @stefangreim observed.

Terraform v0.12.19
+ provider.auth0 v0.4.0

@alexkappa
Copy link
Owner

I am confident the issue is resolved with #162. Feel free to try v0.4.3 and let me know if all is well.

@stefangreim
Copy link
Author

The error is resolved now. The grant works as expected.
Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants