Skip to content
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

Better support for looking up Guest users #160

Closed
joakimhellum opened this issue Oct 15, 2019 · 2 comments · Fixed by #161
Closed

Better support for looking up Guest users #160

joakimhellum opened this issue Oct 15, 2019 · 2 comments · Fixed by #161

Comments

@joakimhellum
Copy link
Contributor

joakimhellum commented Oct 15, 2019

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

Description

Looking up Guest users (from External Active Directory) is tiresome, because they have user_principal_name in format of <local-part>_<domain>#EXT#@<initial-domain>, and then mail_nickname is typically <local-part>_<domain>#EXT# (read more about mailNickname here).

Because john.smith_example.com#EXT#@example.onmicrosoft.com is not very friendly user_principal_name, it would be nice to be able to lookup users by mail. However since not all users have mail, it is perhaps better to do lookup by mail_nickname or user_principal_name using startswith filter operator (so that a user with #EXT# appended to name is still returned).

Example properties for Guest user:

mail = "john.smith@example.com"
mail_nickname = "john.smith_example.com#EXT#"
user_principal_name = "john.smith_example.com#EXT#@example.onmicrosoft.com"

I would be happy to make a PR for this.

New or Affected Resource(s)

  • azuread_user (Data source)
  • azuread_users (Data source)

Potential Terraform Configuration

data "azuread_user" "main" {
  mail_nickname = "john.smith" # lookup by mail nickname using startswith filter operator
  mail = "john.smith@example.com" # or by using mail
}

References

  • N/A
@ghost
Copy link

ghost commented Nov 15, 2019

This has been released in version 0.7.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azuread" {
    version = "~> 0.7.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Nov 16, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 16, 2019
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.

2 participants