我正在使用WSO2 Identity Server的4.1.0版。我已經使用了WSO2 AuthenticationAdmin服務(localhost:9443/services/AuthenticationAdmin)來登錄,檢查身份驗證器等。還有一個「註銷」操作。WSO2 AuthenticationAdmin註銷
當soapUI生成註銷請求時,它不包含任何值得注意的元素,如名稱空間爲http://authentication.services.core.carbon.wso2.org的模式(xsd)所證實的。 SOAP請求體如下。
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:aut="http://authentication.services.core.carbon.wso2.org">
<soap:Header/>
<soap:Body>
<aut:logout/>
</soap:Body>
</soap:Envelope>
發送請求時,RAW響應如下。
HTTP/1.1 202 Accepted
Date: Wed, 26 Jun 2013 08:29:48 GMT
Server: WSO2 Carbon Server
Content-Type: text/xml;charset=UTF-8
Set-Cookie: JSESSIONID=94784CC9FC03E9FA3822CFDDAD0D36F6; Path=/; Secure; HttpOnly
Vary: Accept-Encoding
Content-Encoding: gzip
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
首先,我認爲在響應中沒有SOAP消息。此外,HTTP狀態是202,這意味着請求被接受處理,但處理尚未完成。
如何使用此服務註銷?
應將哪些元素添加到< aut:logout>?
應該將JSESSIONID添加到請求的標題中嗎?
如何將此註銷與loginWithRememberMeOption結合使用?
------- UPDATE 在回顧了xsd之後,我發現必須將一個wsa:action添加到SOAP Header中。這樣做後,我收到了以下答覆。該答覆要求輸入MessageID。但我不確定這個值應該是什麼。
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Action>http://www.w3.org/2005/08/addressing/fault</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<soapenv:Fault>
<soapenv:Code>
<soapenv:Value>soapenv:Sender</soapenv:Value>
<soapenv:Subcode>
<soapenv:Value xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:MessageAddressingHeaderRequired</soapenv:Value>
</soapenv:Subcode>
</soapenv:Code>
<soapenv:Reason>
<soapenv:Text xml:lang="en-US">A required header representing a Message Addressing Property is not present</soapenv:Text>
</soapenv:Reason>
<soapenv:Detail>
<wsa:ProblemHeaderQName xmlns:wsa="http://www.w3.org/2005/08/addressing">wsa:MessageID</wsa:ProblemHeaderQName>
</soapenv:Detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
當添加一個生成的MessageID時,它又是一個帶有HTTP 202狀態的空SOAP響應。
Afaik當您登錄時,將創建HTTP會話並將會話ID cookie發送給您。當你執行註銷時,你應該把這個cookie設置爲一個頭部請求。 –
嗨阿德里安。我試過了,如下所示: - 將生成的註銷soap請求保持原樣。 - 在名爲'cookie'的SOAP請求中添加了值爲'JSESSIONID = EC91C18055FD38EF0FB112D301386B25;路徑= /;安全;僅Http」(就像我收到了上登錄) - 啓用WS Adressing - 已啓用郵件ID產生 的響應是一個空的SOAP響應,再次與HTTP狀態202 當我不啓用WS尋址,響應也空,202. 當我啓用WS Adressing,但不添加MessageID時,SOAP錯誤說我必須添加它。 – JimRoy