Search code examples
azure-active-directoryazure-ad-graph-apimicrosoft-identity-platform

Get object identifier of Microsoft account from shared tenant (9188040d-6c67-4c5b-b112-36a304b66dad)


Is there a way to get value of "objectIdentifier" claim for Microsoft account?

Case: I have an app with one form field, email (need's to be Microsoft account). When this email is entered, server (back end) need's to find out value of object identifier (user ID) in common tenant for all Microsoft accounts (section "tid").

Normally, if this was normal tenant in Azure Active Directory I would create Azure AD app and generated client secret for accessing Graph API, directory endpoint. Unfortunately, this is "special" tenant and I don't know is there any API I can call (as application) to get id of user (best option would be GetUserIdByEmail(email)).

I understand this is weird case but life is hard :)

Asking user to login and then retrieving value from token is not an option!


Solution

  • There is no API that I'm aware of where you could query for MS personal accounts' info without logging a user in.

    If you think about it, it would be quite an easy source of building a user list for attacks :)

    You will need to log them in to get their id, I don't think you can know it in advance.