随笔 - 911  文章 - 5  评论 - 94  阅读 - 243万

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);

 

posted on   momingliu11  阅读(19)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2023-06-28 mysql随笔
2022-06-28 查询3天内创建邮箱的用户
2022-06-28 IIS新建站点、配置应用程序池
2013-06-28 环境变量、语言类型转换、静态类、字符串
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示