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

azuread_group: Support for AzureAD B2B user invitations (guests) #41

Closed
daniel-simpson opened this issue Feb 12, 2019 · 16 comments · Fixed by #401
Closed

azuread_group: Support for AzureAD B2B user invitations (guests) #41

daniel-simpson opened this issue Feb 12, 2019 · 16 comments · Fixed by #401

Comments

@daniel-simpson
Copy link

daniel-simpson commented Feb 12, 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

Building on this comment, I would like to be able to add guest users to a group using AzureAD B2B.

My use case for this is a clean separation of concerns between user authentication (handled in a separate tenant) and authorization (RBAC on groups). There are Microsoft Graph APIs available for:

The main part I can't get my head around is whether or not this would require an azuread_guest resource type or if we can infer it using the first snippet below.

If we don't need a new azuread_guest resource type, the side effect of extra guest users in this tenant is mitigated by the fact that once removed from all groups, the invited guest's permissions are effectively zero, though I'm aware that in Terraform we don't like things to be implicit 😄

New or Affected Resource(s)

  • azuread_group
  • (Optional) azuread_guest

Potential Terraform Configuration

resource "azuread_group" "mygroup" {
  name = "MyGroup"
  # owners = ["foo.bar@example.com"]
  # members = ["foo.bar2@example.com"]
  guests = ["externalAadUser@test.onmicrosoft.com"]
}

OR

resource "azuread_guest" "guest_invite" {
  email = "test@mail.com"
}

resource "azuread_group" "mygroup" {
  name = "MyGroup"
  members = ["${azuread_guest.guest_invite.id}"]
}

References

@Lachlan-White
Copy link

Would be very interested in this functionality!

@katbyte katbyte added this to the Blocked milestone May 23, 2019
@katbyte katbyte changed the title Support for AzureAD B2B user invitations azuread_group: Support for AzureAD B2B user invitations (guests) May 23, 2019
@dansanabria
Copy link

wonder if there's an update on this ?

@CodingAnarchy
Copy link

Wanted to note for our desired use case, we want the azuread_guest without concern for groups. We can use groups if that's how it is implemented, but mainly we just need to invite a guest user and assign them roles, which would be great if we can do it all via Terraform.

@yuri-tieto
Copy link

Any update on this one?

@angeloedades
Copy link

Hi guys, just wanted to add - this feature would be really useful in helping me manage users in code. Is there a rough timeline that we can expect some progress? I know from the previous update that the API required is not avialable in Go. Have you guys reached out to Microsoft?

@angeloedades
Copy link

Hi Issue Followers,

If this feature is something that you would like make sure to vote on #307 too

@manicminer
Copy link
Contributor

Thanks @angeloedades. When I opened the other issue I forgot there already was one, but now they both have upvotes we'll keep them both open 👍

@angeloedades
Copy link

Thanks @manicminer - just to give a bit more background as to why I am 100% in on this feature - I manage a few Azure tenants and the majority of them use B2B users as guests. This feature would immensely help me manage guest users better rather than writing some custom mechanism to issue invites

@bridgepate
Copy link

Please add this feature

@KoenR3
Copy link

KoenR3 commented Feb 10, 2021

Same here, we have a lot of B2B users that need to be managed. Currently we cannot add the management to Terraform and we have to leave the environment for this, which is a shame.

@manicminer manicminer linked a pull request Feb 23, 2021 that will close this issue
@manicminer manicminer modified the milestones: Blocked, v1.5.0 Feb 23, 2021
@manicminer
Copy link
Contributor

This functionality has been merged with #401, which adds a user_type property to the azuread_user resource - you should then be able to add guest users as group members.

@bridgepate
Copy link

bridgepate commented Feb 23, 2021 via email

@manicminer
Copy link
Contributor

Unfortunately we need to revert the support for this property as the API appears very broken, more info in #413

We'll keep this issue closed and supercede it with 307 since that's focused on the invitations API in MS Graph. This feature is prominently on our roadmap and we'll be implementing it as soon as we are able.

@manicminer
Copy link
Contributor

For group member support, I would suggest looking up guest users with the azuread_user data source, which supports user principal names in the format user_guestcorp.com#EXT#@invitingtenant.net. You will need to create these users out of band for now.

@ghost
Copy link

ghost commented Mar 25, 2021

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 as resolved and limited conversation to collaborators Mar 25, 2021
@ghost
Copy link

ghost commented May 20, 2021

This has been released in version 1.5.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 = "~> 1.5.0"
}
# ... other configuration ...

@ghost ghost unlocked this conversation May 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators May 20, 2021
@manicminer manicminer removed this from the v1.5.0 milestone May 27, 2021
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.

10 participants