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 2024-06-28 09:42  momingliu11  阅读(5)  评论(0编辑  收藏  举报