簡體   English   中英

使用SOAP API將SAMLSSO提供程序配置添加到服務提供程序

[英]Adding SAMLSSO provider config to service provider using SOAP API

當我創建服務提供者並通過Identity Server管理面板的Web UI添加入站身份驗證配置-> SAML2 Web SSO配置時 ,一切正常,稍后我會在擴展選項卡中看到SAMLSSO提供者。

現在,我陷入了創建服務提供者並通過API添加SAMLSSO提供者的困境。

我正在使用以下服務來完成這項工作:

IdentityApplicationManagementService?wsdl-用於創建服務提供者。

IdentitySAMLSSOConfigService? wsdl-用於創建SAMLSSO提供程序。

我按順序發送以下請求:

首先創建SAMLSSO提供程序:

    POST /services/IdentitySAMLSSOConfigService.IdentitySAMLSSOConfigServiceHttpsSoap11Endpoint/ HTTP/1.1
    Host: test.com
    Connection: Keep-Alive
    User-Agent: PHP-SOAP/5.6.11-1ubuntu3.4
    Content-Type: text/xml; charset=utf-8
    SOAPAction: "urn:addRPServiceProvider"
    Content-Length: 1228
    Authorization: Basic *****

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope
        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:ns1="http://dto.saml.sso.identity.carbon.wso2.org/xsd"
        xmlns:ns2="http://org.apache.axis2/xsd">
        <SOAP-ENV:Body>
            <ns2:addRPServiceProvider>
                <ns2:spDto>
                    <ns1:assertionConsumerUrl xsi:nil="true"/>
                    <ns1:assertionConsumerUrls>https://test.shib/Shibboleth.sso/SAML2/POST</ns1:assertionConsumerUrls>
                    <ns1:attributeConsumingServiceIndex xsi:nil="true"/>
                    <ns1:certAlias xsi:nil="true"/>
                    <ns1:defaultAssertionConsumerUrl>https://test.shib/Shibboleth.sso/SAML2/POST</ns1:defaultAssertionConsumerUrl>
                    <ns1:digestAlgorithmURI xsi:nil="true"/>
                    <ns1:idpInitSLOReturnToURLs xsi:nil="true"/>
                    <ns1:issuer>https://tesh.shib/shibboleth</ns1:issuer>
                    <ns1:loginPageURL xsi:nil="true"/>
                    <ns1:nameIDFormat xsi:nil="true"/>
                    <ns1:nameIdClaimUri xsi:nil="true"/>
                    <ns1:requestedAudiences xsi:nil="true"/>
                    <ns1:requestedClaims xsi:nil="true"/>
                    <ns1:requestedRecipients xsi:nil="true"/>
                    <ns1:signingAlgorithmURI xsi:nil="true"/>
                    <ns1:sloRequestURL xsi:nil="true"/>
                    <ns1:sloResponseURL xsi:nil="true"/>
                </ns2:spDto>
            </ns2:addRPServiceProvider>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

然后,我使用此處提到的SAMLSSO提供程序創建帶有入站身份驗證配置的服務提供程序:

    POST /services/IdentityApplicationManagementService.IdentityApplicationManagementServiceHttpsSoap11Endpoint/ HTTP/1.1
    Host: test.com
    Connection: Keep-Alive
    User-Agent: PHP-SOAP/5.6.11-1ubuntu3.4
    Content-Type: text/xml; charset=utf-8
    SOAPAction: "urn:createApplication"
    Content-Length: 1934
    Authorization: Basic ****


    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope
        xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:ns1="http://model.common.application.identity.carbon.wso2.org/xsd"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:ns2="http://org.apache.axis2/xsd">
        <SOAP-ENV:Body>
            <ns2:createApplication>
                <ns2:serviceProvider>
                    <ns1:applicationName>tect_com</ns1:applicationName>
                    <ns1:claimConfig xsi:nil="true"/>
                    <ns1:description>Test SP</ns1:description>
                    <ns1:inboundAuthenticationConfig>
                        <ns1:inboundAuthenticationRequestConfigs>
                            <ns1:friendlyName xsi:nil="true"/>
                            <ns1:inboundAuthKey>https://test.shib/shibboleth</ns1:inboundAuthKey>
                            <ns1:inboundAuthType>samlsso</ns1:inboundAuthType>
                            <ns1:properties xsi:nil="true"/>
                        </ns1:inboundAuthenticationRequestConfigs>
                        <ns1:inboundAuthenticationRequestConfigs>
                            <ns1:friendlyName xsi:nil="true"/>
                            <ns1:inboundAuthKey></ns1:inboundAuthKey>
                      <ns1:inboundAuthType>openid</ns1:inboundAuthType>
                            <ns1:properties xsi:nil="true"/>
                        </ns1:inboundAuthenticationRequestConfigs>
                        <ns1:inboundAuthenticationRequestConfigs>
                            <ns1:friendlyName xsi:nil="true"/>
                            <ns1:inboundAuthKey></ns1:inboundAuthKey>
                            <ns1:inboundAuthType>passivests</ns1:inboundAuthType>
                            <ns1:properties xsi:nil="true"/>
                        </ns1:inboundAuthenticationRequestConfigs>
                    </ns1:inboundAuthenticationConfig>
                    <ns1:inboundProvisioningConfig xsi:nil="true"/>
                    <ns1:localAndOutBoundAuthenticationConfig xsi:nil="true"/>
                    <ns1:outboundProvisioningConfig xsi:nil="true"/>
                    <ns1:owner>
                        <ns1:tenantDomain>user.com</ns1:tenantDomain>
                        <ns1:userName>user</ns1:userName>
                        <ns1:userStoreDomain xsi:nil="true"/>
                    </ns1:owner>
                    <ns1:permissionAndRoleConfig xsi:nil="true"/>
                    <ns1:requestPathAuthenticatorConfigs xsi:nil="true"/>
                    <ns1:saasApp>true</ns1:saasApp>
                    <ns1:spProperties xsi:nil="true"/>
                </ns2:serviceProvider>
            </ns2:createApplication>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

兩個請求都被接受。 我可以在Web UI中看到服務提供者,但是“ SAML Web SSO配置”部分為空。

如果我嘗試使用新的SP進行身份驗證,則一切正常。

如果我嘗試通過Web UI添加相同的SAML SSO配置,則會給我一個錯誤,提示它已經存在。

使用API​​創建SAMLSSO Config時,表SP_INBOUND_AUTH為空。 但是,如果我使用Web UI創建SAML配置,則可以在SP_INBOUND_AUTH表中看到記錄。

我想念什么?

創建服務提供者時,應分兩步完成。

  1. 為給定的應用程序名稱和描述(createApplication)創建服務提供者。
  2. 使用其他配置(updateApplication)更新它。

因此,在您的情況下,僅應使用應用程序名稱和描述來調用createApplication。 然后,您必須調用updateApplication操作並配置其入站身份驗證等。

[1] https://docs.wso2.com/display/IS510/使用+ the + Service + Provider + API#UsingtheServiceProviderAPI-createApplication

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM