-
Notifications
You must be signed in to change notification settings - Fork 91
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
Update roles for user when comes from a external identity provider #473
Comments
Hey @alexhermida 👋🏻 You're getting the Try running an import first and then follow up with a terraform plan, e.g. terraform import auth0_user.user "google-oauth2|111111111111111" && terraform plan You should now be presented with a diff that shows that the roles are about to be assigned to the user. Reference: |
Oh damn, thanks @sergiught for the quick response 🦸🏽 , that makes sense, I've imported many other resources but usually gives me the error the resource already exists and that's why haven't tried and import it. I'll do. Thanks! |
Back to the question as it's not working as expected 😄 The
It looks like it's trying to delete some attributes that exist in the resource (email, given_name..) which I'm not passing in the payload, whereas others is correctly ignoring them (like
|
Hey @alexhermida 👋🏻 Let me see if I can help clarify what's happening and if needed we can do some changes on the So you have an existing user that was created through the GoogleOAuth2 Identity Provider, and this user has an email, family name and other attributes set. If the user has all of that, but your definition is as follows:
Even tho those attributes are optional on the provider, because they are set on remote, terraform will go on and display the diff as it's trying to show to you the out of bounds changes that aren't captured by your configuration. Ideally you'd try to capture everything through the config and bring any divergences in sync by setting as well the email, email_verified, family_name etc. properties as well, e.g.
However admittedly there are a few other resources in our provider that are at the moment configured not to show these divergeces (e.g. connection resource) due to various reasons, like the fact that we can have multiple types of connections with different options, described through the same So my question right now is, what is preventing us from simply capturing all of the user's details through the config? If there is something we can set those parameters to stop showing any diffs between remote and local when not set, but I'd like to do this only if really needed. Let me know if this makes sense, happy to discuss further. |
Hi @sergiught thank for the thoughtful answer! I understand the approach. That's what I finally did, just to complete most of the attributes that bring back the
Said that, now the resource it's working for update users in a Google connector with the following attributes:
I also understand the complexity of maintaining different connections with different mandatory and optional arguments so don't think this is a bug nor I expect any update to this module. I think it's ok to me. Thank you and have a great weekend! |
Checklist
Description
Hi,
I was looking for information but after reading the docs and browsing Github issues it's not clear to me.
I'm using terraform for provisioning all the environments and applications. My users login through a
auth0_connection
(google_oauth2) - and now I would like to manually update some of those users for adding some specific role using the auth0_user resource like:But I'm getting
Looking into the plan, it seems that it's trying to create a user with all the attributes even if I'm only passing the user_id, connection and roles.
Is this a bug or it's something expected?
Expectation
To only update the specific user with the appropriate Auth0 roles even if the user came from a connection.
That's also is my understanding reading the issue #400
Reproduction
Given auth0 independent entities like:
conn_id_1
role_id_1
google-oauth2|101
If I try to assign the role with the
auth0_user
resourceI get:
Thanks!
Auth0 Terraform Provider version
0.43.0
Terraform version
1.3.6
The text was updated successfully, but these errors were encountered: