djangosaml2结合ADFS配置声明规则属性映射
djangosaml2中的SP属性映射配置不同,ADFS所需要配置的声明提供方信任的声明规则也不同,如下:
0.信赖方信任,OWA和ECP的声明颁发规则如下:
djangosaml2 SP配置如下:
1.不配置任何属性字段映射,默认使用NameID,即为新建的用户名称,则ADFS声明规则配置如下:
将NameID转换为UPN
或者使用如下自定义规则:
c:[Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] == "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"]
=> issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"), query = ";userPrincipalName;test19\{0}", param = c.Value);
2.新建用户,并配置Email字段为用户UPN名称,属性映射配置如下:
将Email字段映射为UPN,ADFS新建“经历或筛选传入声明”类型规则,如下
3.新建用户,并配置First_name字段为用户AD中的SamAccountName,将该属性映射为windowsaccountname,配置如下:
{
"email": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn",
"first_name": "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname",
"last_name": "last_name",
"is_staff": "is_staff",
"is_superuser": "is_superuser"
}
ADFS配置“转换传入声明”类型规则如下
或者使用自定义规则如下:
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"]
=> issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"), query = ";userPrincipalName;test19\{0}", param = c.Value);
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
2023-06-28 mysql随笔
2022-06-28 查询3天内创建邮箱的用户
2022-06-28 IIS新建站点、配置应用程序池
2013-06-28 环境变量、语言类型转换、静态类、字符串