I’ve configured my vault to use oidc as auth method and pointed it to my company IDP.
I’m trying to figure out how I can create an entity for a new employee and bind an alias for their future OIDC login using terraform, and bind this alias to the entity.
Right now when the user has logged on the first time, I see the mount path and all, but BEFORE the user has logged on at all, how can I pre-create the oidc mount for the user and connect it to the right entity using terraform?
The goal is to allow our operations team to pre-create the users and all relevant policies in vault using terraform before the user has even started at the company, so the first day of joining the company everything “just works”.
Second: An entity is just a way of grouping together multiple entity-aliases (which must be from different auth methods), in case you want to, for example, treat “ahnberg logging in via OIDC” as the same identity as “ahnberg logging in via some other backup authentication method you set up”.
However, a lot of the time, this grouping functionality goes unused, and all/most entities just have a single entity-alias each.
So, in your case, you just need to figure out what your OIDC provider will call the new user, and then you can set up the Vault entity and entity-alias using that.
Thank you!
I had understood the concept of identity and identity_alias well. I love the idea!
My confusion was the vault_identity_entity_alias resource in terraform where I assumed wrongly that mount_accessor argument was a unique string per user, while in fact it was the same string for each user based on the OIDC mount accessor only.