简体   繁体   English

使用SSP和ADFS作为IdP代理的WordPress单一登录

[英]WordPress Single Sign On using SSP and ADFS as IdP proxy

Well, I have been stuck for days at this and SO is my only hope. 好吧,我已经为此困扰了好几天,所以我是唯一的希望。

I have configured Windows 2012 r2 with ADFS 3.0, bitnami Wordpress (4.2.2) with SAML 2.0 Single Sign on plugin and Ubuntu server with SimpleSAMLphp 1.13. 我已使用ADFS 3.0配置了Windows 2012 r2,使用SAML 2.0 Single Sign on插件配置了bitnami Wordpress(4.2.2),并使用SimpleSAMLphp 1.13配置了Ubuntu服务器。

Wordpress configuration looks like this: WordPress的配置看起来像这样:

WordPress NameID policy: WordPress NameID政策: WordPress NameID政策

WordPress attributes: WordPress属性: WordPress属性

For authentication source I am using SSP's file module. 对于身份验证源,我正在使用SSP的文件模块。 It has attributes: 它具有以下属性:

User-Name for user id, mail for user's email-address and Filter-Id for user's group. User-Name用于用户ID, mail用于用户的电子邮件地址, Filter-Id用于用户的组。

At ADFS side, I have configured claims provider trust as SSP and relying party's trust as WP. 在ADFS方面,我已将声明提供者信任配置为SSP,将依赖方的信任配置为WP。

Claim rules for those are: 这些索赔规则如下:

SSP: SSP:

Rule 1: To transform name id policy. 规则1:转换名称ID策略。 If this rule is not set WP's SSP gives NameIDPolicy invalid error. 如果未设置此规则,则WP的SSP会给出NameIDPolicy无效错误。

c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] == "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"] => issue(Type = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", Issuer = c.Issuer, OriginalIssuer = c.OriginalIssuer, Value = c.Value, ValueType = c.ValueType);

Rule 2: Pass all the claims 规则2:通过所有索赔

c:[Type == "https://example.com/simplesamlphp/saml2/idp/metadata.php"] => issue(claim = c);

WordPress: WordPress:

Rule 1: Convert name attribute to WP's attribute 规则1:将名称属性转换为WP的属性

c:[Type == "User-Name"] => add(Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Value = c.Value);

Rule 2: Convert mail attribute 规则2:转换邮件属性

c:[Type == "mail"] => add(Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/emailaddress", Value = c.Value);

Rule 3: Convert group attribute 规则3:转换组属性

c:[Type == "Filter-Id"] => add(Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/Group", Value = c.Value);

Rule 4: Convert to Givenname attribute 规则4:转换为Givenname属性

c:[Type == "User-Name"] => add(Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/givenname", Value = c.Value);

Rule 5: Convert to Surname attribute 规则5:转换为姓氏属性

c:[Type == "User-Name"] => add(Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/surname", Value = c.Value);

Rule 6: Convert Name id policy & issue all claims 规则6:转换名称ID政策并提出所有声明

c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"] => issue(Type = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", Issuer = c.Issuer, OriginalIssuer = c.OriginalIssuer, Value = c.Value, ValueType = c.ValueType, Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress");

User gets authenticated fine (SP/IdP-Initiated). 用户可以通过身份验证(SP / IdP启动)。 But at WP side I get error saying Username was not provided . 但是在WP端,我收到错误消息Username was not provided

ADFS tracer log shows me SSO token is null or empty. Cannot write SSO token to Cookies. ADFS跟踪日志显示我的SSO token is null or empty. Cannot write SSO token to Cookies. SSO token is null or empty. Cannot write SSO token to Cookies.

I checked IdP for user login and it shows user logged in. Tracer log also shows Valid assertion returned from 'https://example.com/simplesamlphp/saml2/idp/metadata.php' 我检查了IdP的用户登录名,它显示了用户已登录。跟踪器日志还显示了Valid assertion returned from 'https://example.com/simplesamlphp/saml2/idp/metadata.php'

I guess there is something wrong with claims rules, but I am not sure because configuration looks and works fine. 我认为声明规则有问题,但是我不确定,因为配置看起来不错。

Any pointers are welcome! 任何指针都欢迎!

Thanks! 谢谢!

So the chain is WP --> ADFS --> SSP 所以链是WP-> ADFS-> SSP

Normally for NameID, you use a transform rule eg 通常对于NameID,您使用转换规则,例如

Transform email to NameID with a format of email. 使用电子邮件格式将电子邮件转换为NameID。

For the CP, you need pass-through rules for each attribute. 对于CP,您需要每个属性的传递规则。

This rule "c:[Type == " https://example.com/simplesamlphp/saml2/idp/metadata.php "] => issue(claim = c);" 此规则“ c:[Type ==“ https://example.com/simplesamlphp/saml2/idp/metadata.php ”] => issue(claim = c);“ does not pass-through all rules - best to do them individually. 不会通过所有规则-最好单独执行。

The RP rules look right but the NameID rule has a format of email so it should be derived from email, not name. RP规则看起来不错,但是NameID规则具有电子邮件格式,因此应从电子邮件而非名称派生。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM