Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WSO2 Identify服务器能否在SAML响应的NameID中发回电子邮件地址?_Wso2_Saml_Wso2is - Fatal编程技术网

WSO2 Identify服务器能否在SAML响应的NameID中发回电子邮件地址?

WSO2 Identify服务器能否在SAML响应的NameID中发回电子邮件地址?,wso2,saml,wso2is,Wso2,Saml,Wso2is,我正在尝试使用云应用程序配置WSO2 Identity Server 到目前为止,我已设法: 正在重定向到WSO2的云应用正在运行,并显示其登录页面 WSO2登录正在根据LDAP支持的辅助用户存储成功进行身份验证 但是,云应用程序登录仍然失败。我认为这是因为SAML响应具有用户名,而云应用程序希望用户的电子邮件地址而不是用户名。我这么说是因为你在云应用程序中配置用户的电子邮件地址而不是用户名 那么,你能得到什么呢?WSO2是返回电子邮件地址而不是用户名。我附上SAML以说明我的意思,我希望在字段

我正在尝试使用云应用程序配置WSO2 Identity Server

到目前为止,我已设法:

  • 正在重定向到WSO2的云应用正在运行,并显示其登录页面
  • WSO2登录正在根据LDAP支持的辅助用户存储成功进行身份验证
  • 但是,云应用程序登录仍然失败。我认为这是因为SAML响应具有用户名,而云应用程序希望用户的电子邮件地址而不是用户名。我这么说是因为你在云应用程序中配置用户的电子邮件地址而不是用户名

    那么,你能得到什么呢?WSO2是返回电子邮件地址而不是用户名。我附上SAML以说明我的意思,我希望在
    字段中返回我的电子邮件地址,而不是我的用户名
    smith

    <?xml version="1.0" encoding="UTF-8"?>
    <saml2p:Response Destination="https://cloudapp.com/auth/saml/callback"
                 ID="ijnccdceglphfggpnhhdkckhdkendndabahdjlef" InResponseTo="_4b740f60-a420-0132-eb44-002590a743aa"
                 IssueInstant="2015-03-03T22:12:25.000Z" Version="2.0"
                 xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol">
    <saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity"
                  xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">localhost
    </saml2:Issuer>
    <saml2p:Status>
        <saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
    </saml2p:Status>
    <saml2:Assertion ID="kjggobfabnbnfnpbngjeeolfjjjoimapmkpadbfl" IssueInstant="2015-03-03T22:12:25.000Z" Version="2.0"
                     xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">
        <saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">localhost</saml2:Issuer>
        <saml2:Subject>
            <saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">smith</saml2:NameID>
            <saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
                <saml2:SubjectConfirmationData InResponseTo="_4b740f60-a420-0132-eb44-002590a743aa"
                                               NotOnOrAfter="2015-03-03T22:17:25.000Z"
                                               Recipient="https://cloudapp.com/auth/saml/callback"/>
            </saml2:SubjectConfirmation>
        </saml2:Subject>
        <saml2:Conditions NotBefore="2015-03-03T22:12:25.000Z" NotOnOrAfter="2015-03-03T22:17:25.000Z">
            <saml2:AudienceRestriction>
                <saml2:Audience>https://cloudapp.com/</saml2:Audience>
            </saml2:AudienceRestriction>
        </saml2:Conditions>
        <saml2:AuthnStatement AuthnInstant="2015-03-03T22:12:25.001Z">
            <saml2:AuthnContext>
                <saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:Password</saml2:AuthnContextClassRef>
            </saml2:AuthnContext>
        </saml2:AuthnStatement>
    </saml2:Assertion>
    
    
    本地服务器
    本地服务器
    史密斯
    https://cloudapp.com/
    urn:oasis:name:tc:SAML:2.0:ac:classes:Password
    

    是的。您可以通过使用WSO2IS中的配置来实现这一点。默认情况下,WSO2IS返回经过身份验证的用户名。但是,您可以选择必须作为
    SAML2断言中的
    NameID
    添加身份验证用户的哪个属性。如果您使用的是IS 5.0.0,则在声明配置下,您可以找到名为
    主题声明URI:
    的配置。在这里,您可以选择所需的声明uri,该uri必须被选为
    NameID
    。您可以在“SAML2断言的用户名”主题下找到更多配置详细信息

    但是,当您使用电子邮件时,如果发现任何问题,您可能需要在
    carbon.xml
    文件中配置以下元素。然而,上面的链接包含更多关于它的信息


    true

    谢谢@asela这确实解决了我们的问题。但我确实事先安装了服务包和补丁,所以不确定这会产生多大影响。现在我们有另一个问题,但我将把它放在另一个问题中。