多租户Azure AD应用程序中的唯一用户ID [英] Unique user id in multi tenant Azure AD apps

查看:155
本文介绍了多租户Azure AD应用程序中的唯一用户ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您是否知道多租户Azure AD应用程序模式中的唯一用户ID ?

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

我现在正在使用带有Azure AD Microsoft Graph 的应用程序="https://docs.microsoft.com/zh-cn/azure/active-directory/develop/active-directory-devhowto-multi-tenant-overview" rel ="nofollow noreferrer">多租户应用程序模式.为了识别每个用户,我想知道唯一的ID-我将其用作我们自己的数据库中的键,以保存用户的数据.

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.

在此参考,用户对象中的id参数是用户的唯一标识符",但我想知道在每个租户中还是在所有租户中,它的唯一ID ?这很重要,因为我的应用程序将在多租户中使用.

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.

仅供参考: 如果用户ID仅在每个租户中都是唯一的,我将串联

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.

推荐答案

id属性是一个随机GUID.虽然不可能有两个具有相同ID的用户,但是除非在Azure中进行检查,否则可能会发生.

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.

我将其与租户ID串联在一起,甚至更好的是在数据库的另一列中包含该租户ID.这样,您可以在数据库中按租户查询用户.

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.

这篇关于多租户Azure AD应用程序中的唯一用户ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆