Unique user id in multi tenant Azure AD apps

依然范特西╮ 提交于 2019-12-11 04:32:02

问题


Do you know the unique user id in multi tenant Azure AD apps pattern?

I'm now developing app using Microsoft Graph with Azure AD multi-tenant application pattern. For identifying each user I want to know the unique id - I'll use it as a key in our own database to save user's data.

In this reference, id parameter in user object is "The unique identifier for the user", but I wonder is it unique id in each tenant or in all tenant? It is important thing because my app will use in multi tenant.

FYI: If user id is unique only in each tenant, I'll concatenate organization id and user id for making unique id in all tenant.


回答1:


The id property is a random GUID. While it would be unlikely to have two users with identical IDs, unless there is a check in Azure, it could happen.

I would concatenate it with the tenant ID, or even better have the tenant ID in another column in the DB. That way you can query users on a per-tenant basis in your DB.



来源:https://stackoverflow.com/questions/42747115/unique-user-id-in-multi-tenant-azure-ad-apps

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