title: Open SSO Authentication failure when invoking via Oracle PLSQL
body: <p>I am an Oracle Developer, we have a requirement to read the contents of a filenet documents via oracle database , but OpenSSO is enabled in our environments which is currently blocking us to read the data from filenet server.</p>
  <p>While checking with OpenSSO guys , they confirmed that while invoking the filenet URL via browser , a session cookie gets generated in OpenSSO which plays a significant role in authentication.</p>
  <p>But , when we tried to invoke the same filenet URL via Oracle pl/sql ( i.e database) , we could see the cookie details as below. However, we don't understand , why opensso was still not showing  'successful authentication'.
  We googled the error code X-AuthErrorCode: -1 which says  &quot;In the response you're going to receive &quot;X-autherrorcode&quot; header, if it's value 0, then the login was successful. Also, you need to check the
  iPlanetDirectoryPro cookie for admin session id&quot;.
  With all these information, can someone please help us in getting the root cause of the authentication failure in OpenSSO?</p>
  <pre><code>   HTTP response status code: 200
     HTTP response reason phrase: OK
     X-Powered-By: JSP/2.1
     Server: Sun GlassFish Enterprise Server v2.1
     Cache-Control: private
     Pragma: no-cache
     Expires: 0
     X-DSAMEVersion: (2011-March-02 18:42)
     AM_CLIENT_TYPE: genericHTML
     Set-Cookie: 
     AMAuthCookie=AQIC5wM2LY4SfcyXSVnslvF7a5TLMa4KXz5Op9tRKzczinU.*AAJTSQACMDE. 
    *; Domain=.companyname.co.uk; Path=/
    Set-Cookie: amlbcookie=01; Domain=.companyname.co.uk; Path=/
    X-AuthErrorCode: -1
    Set-Cookie: AMAuthCookie=LOGOUT; Domain=.companyname.co.uk; 
    Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
    Set-Cookie: JSESSIONID=286b0c94d89dffd4f602831969ae; Path=/opensso; 
    Secure
    Content-Type: text/html;charset=UTF-8
    Date: Fri, 24 Oct 2014 14:19:23 GMT
    Connection: close
  </code></pre>
  <h2>While downloading a Text file from filenet, we got the content as below</h2>
  <p>HTTP Status 401 -
  type Status report
  message
  descriptionThis request requires HTTP authentication ().
  Sun GlassFish Enterprise Server v2.1.1</p>
  <p>Can someone please help me at the earliest to get a solution for this ? Is this really possible to make the authentication success via oracle database packages rather than invoking the URL via browser ? if it is possible what should be next step I need to do  ?</p>
  <p>Any help would be much appreciated.</p>
  <p>Thanks and Regards,
  Remya Sudhakaran</p>