0

我需要向不匹配特定 LDAP 属性的每个人授予声明。我想使用带有负面展望的正则表达式来执行这个“not”子句

c1:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", Value =~ "^(?!Test User).*$"]
 => issue(Type = "http://goofyclaim", Value = "youre not a tester");

我的测试用户似乎并不满意上述规则。正则表达式有问题吗?还是 ADFS4.0 不支持它。我在 ADFS 事件日志中看不到任何错误。

这是 win2012r2 AD 域上的 win2016srv。

作为参考,这条规则确实有效:

c1:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", Value =~ "(?i)^Test User1"]  
 => issue(Type = "http://somethignelseentreily", Value = "imispellwhendriving");
4

2 回答 2

0

首先我需要为 REGEXP_NOT_MATCH使用(在这里找到ADFS 规则语言终端)

!~

接下来,我必须通过在 ^ 标识符中不区分大小写来稍微重构正则表达式模式修饰符

c1:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", Value !~ "^(?i)Test User"]
 => issue(Type = "http://somethignelseentreily", Value = "imispellwhendriving");
于 2018-09-05T20:30:40.607 回答
0

(留下我的其他答案,以便其他人可以看到它不是right答案)

NOT EXISTS([Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", Value =~ "^Test User"])
 => issue(Type = "http://somethignelseentreily", Value = "all");
于 2018-10-12T04:12:49.003 回答