Adding guest users to Azure AD with an automated script?

你离开我真会死。 提交于 2021-01-29 13:29:20

问题


Is there a way to add guest users to Azure AD in an automated way?

The process should work like this:

  1. A user is sending his microsoft address (e.g. john_doe@hotmail.com) via a form to our web service
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!