2015-04-21 61 views
0

我正在使用ADFS實施SP啓動的SSO。我將SAMLRequest提交給ADFS,在確認SAMLRequest後,ADFS回覆SAMLResponse
在ADFS中,聲明規則將UPN映射到名稱ID。但我無法在SAMLResponse中看到名稱ID或UPN。在我的SAMLRequest中是否需要告訴ADFS,還是ADFS中的一些配置問題?來自ADFS的SAMLResponse中的UserPrincipalName(UPN)

這裏是我的SAMLRequest:

<?xml version="1.0" encoding="UTF-8"?> 
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" 
    AssertionConsumerServiceURL="https://http://testurl.com/mysite/samlrequest" 
    ForceAuthn="false" ID="_bec424fa5103428909a30ff1e31168327f79474984" 
    IsPassive="false" IssueInstant="2015-04-22T11:49:03.815Z" 
    ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" 
    Version="2.0"> 
    <saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">http://testurl.com/mysite</saml:Issuer> 
    <samlp:NameIDPolicy AllowCreate="true" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient" /> 
    <samlp:RequestedAuthnContext Comparison="exact"> 
     <saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef> 
    </samlp:RequestedAuthnContext> 
</samlp:AuthnRequest> 
+0

是它顯示了''斷言,而不是''節? – explunit

+0

你使用轉換規則? – nzpcmad

+0

@explunit的SAMLResponse我已經收到了多年平均值包含的部分< AttributeStatement>或全部3210個元素。 –

回答

0

我不知道你的要求規則的樣子,但我映射電子郵件地址屬性的NameIdentifier和它的作品。這應該是自定義規則在ADFS,應該是這樣的:

c:[Type == " http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn "] => 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:2.0:nameid-format:transient", Properties[" http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/spnamequalifier "] = "SP_ENTITY_ID");

如果您要發送此作定語,只是創建一個使用「發送LDAP屬性爲索賠」

我知道這是遲到的規則,但希望這可以幫助別人。