title: Implementing SAML Single Logout on Weblogic - How to get SessionIndex from Weblogic / IdP?
body: <p>I need to implement SAML 2.0 Single logout using WSO2 Identity Server as the identity provider and Weblogic 11g as service provider. </p>
  
  <p>According to SAML specification, there are two different roles service providers participating in the single logout process can take: the service provider who started it, who sends an LogoutRequest to the identity provider, and the service providers who get a LogoutRequest from the identity server and respond accordingly with a LogoutResponse and close their respective sessions. When those service providers have finished the identity provider then responds accordingly to the first service provider who started it all with a LogoutResponse of its own. <a href="http://winfinit.tumblr.com/post/84924299219/saml2-single-logout-slo-with-wso2-is-4-5" rel="nofollow">http://winfinit.tumblr.com/post/84924299219/saml2-single-logout-slo-with-wso2-is-4-5</a></p>
  
  <p>In this scenario I need to implement the first role, when my custom servlet generates the LogoutRequest and sends it to the identity server: since Weblogic 11g surprisingly doesn't support SAML2 Single Logout a servlet will generate and respond according to the SAML specification and close the session using the ServletAuthentication.logout() method in the Weblogic API. </p>
  
  <pre><code>&lt;?xml version="1.0" standalone="yes"?&gt; 
  &lt;saml2p:LogoutRequest 
      xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" 
      ID="jofpphihclkakoifhaeenbdeakfidojehgnpobpg" 
      IssueInstant="2014-05-05T20:00:13.653Z" 
      NotOnOrAfter="2014-05-05T20:05:13.653Z" 
      Reason="Single Logout" 
      Version="2.0"&gt;
      &lt;saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"&gt;web3001&lt;/saml2:Issuer&gt;
      &lt;saml2:NameID xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity"&gt;admin&lt;/saml2:NameID&gt; 
      &lt;saml2p:SessionIndex&gt;8c97787b-48f5-425d-8f88-39befe58eaad&lt;/saml2p:SessionIndex&gt;
  &lt;/saml2p:LogoutRequest&gt;
  </code></pre>
  
  <p>Which is the best way for getting the values for filling in the last two attributes, namely saml2:NameID and saml2p:SessionIndex?</p>