11 Replies Latest reply on Aug 2, 2012 11:36 AM by 943620

    Authentication for bussines services in OSB

    824202
      Hello all ,
      I had a business services that made a call to wsdl based SharePoint service . But when I tried to call a method from wsdl - I get this error in the test window from OSB .
      " The invocation resulted in an error: Unauthorized. "
      Where should I attached also the authentication information ?

      Many thanks in advance ,
      Stefan
        • 1. Re: Authentication for bussines services in OSB
          Anuj Dwivedi--Oracle
          Hi Stefan,

          Which kind of authentication is required? HTTP basic authentication or SOAP header based security authentication?

          Regards,
          Anuj
          • 2. Re: Authentication for bussines services in OSB
            824202
            Hello ,
            this is ResponseMetadata from the test - so it will be http authenticate ?

            Best regards,
            Stefan

            <con:metadata xmlns:con="http://www.bea.com/wli/sb/test/config">
            <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <tran:user-header name="MicrosoftSharePointTeamServices" value="14.0.0.4762"/>
            <tran:user-header name="SPRequestGuid" value="a4652831-2cbe-4aaa-8689-74d0f7f976d0"/>
            <tran:user-header name="X-Powered-By" value="ASP.NET"/>
            <http:Content-Length>0</http:Content-Length>
            <http:Date>Tue, 11 Jan 2011 14:17:03 GMT</http:Date>
            <http:Server>Microsoft-IIS/7.5</http:Server>
            <http:WWW-Authenticate>NTLM</http:WWW-Authenticate>
            </tran:headers>
            <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">1</tran:response-code>
            <tran:response-message xmlns:tran="http://www.bea.com/wli/sb/transports">Unauthorized</tran:response-message>
            <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">iso-8859-1</tran:encoding>
            <http:http-response-code xmlns:http="http://www.bea.com/wli/sb/transports/http">401</http:http-response-code>
            </con:metadata>
            • 3. Re: Authentication for bussines services in OSB
              Anuj Dwivedi--Oracle
              <http:WWW-Authenticate>NTLM</http:WWW-Authenticate>
              This line creates a doubt whether NTLM authentication is required.
              so it will be http authenticate ?
              Well, to support basic authentication you need to follow below steps in OSB -

              1. Create a service account with desired username and password
              2. In HTTP Transport Configuration of your business service, select "Basic" in "Authentication" setting and browse the service account you created in "Service Account" setting at same page
              3. Save and activate the configuration
              4. Test the business service using OSB test console

              Regards,
              Anuj
              • 4. Re: Authentication for bussines services in OSB
                675595
                NTLM authentication is not supported with OSB out of box. You can search this SOA Suite Forum with Key word NTLM and you will find results. From my understanding Kerberos superseded NTLM. OSB has support for Kerebros tokens.

                Re: How to enable NTLM authentication in OSB???
                Calling .NET NTLM webservice through Oracle Service Bus
                ALSB passing NTLM security credentials to end point URL in business service
                Re: Authentication for bussines services in OSB

                Manoj
                • 5. Re: Authentication for bussines services in OSB
                  830428
                  The OSB does not support NTLM authentication so you must create your own JAR file to do the authentication for you, add it as a resource in your OSB project, and then use a Proxy Service to do a Java Callout to your JAR file.

                  Your Java code can perform NTLM authentication via the following method:

                  private static void authenticate(final String username, final String password) {
                  Authenticator.setDefault(new Authenticator() {

                  @Override
                  public PasswordAuthentication getPasswordAuthentication() {
                  return new PasswordAuthentication(username, password.toCharArray());
                  }
                  });
                  }

                  You must also be careful not to use the default URL constructor! The JAR will work from the commandline, but once deployed to the OSB it will use the WLS HTTP handler bydefault and authentication will fail with an exception like this:

                  java.io.FileNotFoundException: Response: '401: Unauthorized' for url: 'http://your.domain.here/default.aspx' at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:474)...

                  So, instead of constructing your URL like this:

                  URL url = new URL(yourURL);
                  HttpURLConnection http = (HttpURLConnection) url.openConnection();

                  Try this instead:

                  URL url = new URL(null, yourURL, new sun.net.www.protocol.http.Handler());
                  HttpURLConnection http = (HttpURLConnection) url.openConnection();
                  • 6. Re: Authentication for bussines services in OSB
                    824202
                    Hello ,
                    Thanks a lot for your hints - how can I test the java application before to integrate into OSB . Which library should I use ?

                    Many thanks in advance ,
                    Stefan
                    • 7. Re: Authentication for bussines services in OSB
                      824202
                      Hello all ,
                      Thanks a lot for the feedback - I found the example from http://download.oracle.com/javase/6/docs/technotes/guides/net/http-auth.html - I will try to integrate into OSB now .

                      Many thanks again for your support .

                      Best regards,
                      Stefan
                      • 8. Re: Authentication for bussines services in OSB
                        824202
                        Hello all ,
                        How can I identify if the call of the method was performed correctly . I add it a proxy service that contain a java callout to the class that should perform authentication - but I still get the message

                        <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
                        <con:errorCode>BEA-380000</con:errorCode>
                        <con:reason>Unauthorized</con:reason>
                        <con:location>
                        <con:node>RouteNode1</con:node>
                        <con:path>response-pipeline</con:path>
                        </con:location>
                        </con:fault>


                        any hints ?

                        Many thanks in advance ,
                        Stefan
                        • 9. Re: Authentication for bussines services in OSB
                          675595
                          I'm don't quite understand your application. My guess is java call out should also invoke the back-end with payload.No need to use route action unless you only get kerebros/some token that you want to use in route node.

                          Manoj
                          • 10. Re: Authentication for bussines services in OSB
                            824202
                            Hello all ,
                            I was thinking that my java call out to store somehow the authentication and after to add a route node to call the web service - is not the normal way to do it - I'm relative new in Oracle SOA and OSB .
                            So I'm waiting for your suggestions .

                            Many thanks in advance ,
                            Stefan
                            • 11. Re: Authentication for bussines services in OSB
                              943620
                              Hi Stefan,

                              I face the same issue, IS that issue resolved.
                              If yes please help me out.

                              Any body please help me..............

                              Thanks and Regards,
                              Pradeep

                              Edited by: 940617 on Aug 2, 2012 4:36 AM