问题
Is there a way to add guest users to Azure AD in an automated way?
The process should work like this:
- A user is sending his microsoft address (e.g. john_doe@hotmail.com) via a form to our web service
- The service is then adding this user to Azure AD by using the functionality "Invite User".
Is it possible to automate this?
回答1:
An application can create Azure AD B2B invitations using Microsoft Graph. The invited user will still at some point have to go through the invitation redemption process.
Copying the example from the documentation:
POST https://graph.microsoft.com/v1.0/invitations
Content-type: application/json
{
"invitedUserEmailAddress": "yyy@example.com",
"inviteRedirectUrl": "https://myapp.com"
}
To make this request under the identity of the application, the application requires the app-only permission User.Invite.All.
This is documented in detail at:
- https://docs.microsoft.com/en-us/azure/active-directory/b2b/customize-invitation-api
- https://docs.microsoft.com/en-us/graph/api/resources/invitation?view=graph-rest-1.0
来源:https://stackoverflow.com/questions/58659826/adding-guest-users-to-azure-ad-with-an-automated-script