4

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.

Doug Molineux
  • 12,283
  • 25
  • 92
  • 144
  • Did the user agree the invitation email? – Joy Wang Dec 05 '18 at 05:38
  • 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 Dec 05 '18 at 17:11
  • 1
    Have you tried to filter the user like `GET https://graph.microsoft.com/v1.0/users?$filter=mail eq ''` ? We cannot get the GUEST user via email via `GET https://graph.microsoft.com/v1.0/users/`. – Wayne Yang Dec 07 '18 at 03:00
  • 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 Dec 10 '18 at 16:27

1 Answers1

1

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 '<test@outlook.com>'

Wayne Yang
  • 9,016
  • 2
  • 20
  • 40
  • Hi @Doug Molineux , if this answer is helpful, please kindly mark it as an answer so that we can help more people~ Thanks – Wayne Yang Feb 21 '19 at 09:29