4
votes

I am trying to invite a B2B user to our Azure Active Directory instance. This user already a member of their Azure AD under their own company (separate instance).

I am sending a request to

https://graph.microsoft.com/v1.0/invitations

I get this response:

{ HttpsError: [POST https://graph.microsoft.com:443/v1.0/invitations] The user you're inviting already exists in the directory. They can simply sign in into shared apps and resources.

However when I login to the Azure portal, I don't see this users email address. Also, when I try to GET the user via the Graph API, I get this message:

[GET https://graph.microsoft.com:443/v1.0/users/] Resource '' does not exist or one of its queried reference-property objects are not present.

Additionally, user is reporting that they are not able to login using their own login.

1
Did the user agree the invitation email? - Joy Wang-MSFT
Good question, I'm not sure, I'll try to find out. If the invitation has been sent but not accepted, would they exist in our directory? - Doug Molineux
Have you tried to filter the user like GET https://graph.microsoft.com/v1.0/users?$filter=mail eq '<[email protected]>' ? We cannot get the GUEST user via email via GET https://graph.microsoft.com/v1.0/users/<[email protected]>. - Wayne Yang
Thanks for your response @WayneYang-MSFT I was able to find this users email under a different "userPrincipalName" ! I think this leads me down the correct path, I appreciate it! - Doug Molineux

1 Answers

1
votes

I assume that this guest user should already exist in your tenant.

After invitation, the guest user will be created in the Azure AD. This action won't require user accept.

NOTE: We can use the userPrincipalName to query the Member user like this:

GET https://graph.microsoft.com/v1.0/users/<UPNoftheMember>

But we cannot use this to query the guest users. You need to filter the Guest user like this:

GET https://graph.microsoft.com/v1.0/users?$filter=mail eq '<[email protected]>'