Advertisements
RSS

Tag Archives: OWSM

Using the Oracle Credential Store Framework (CSF) in your Oracle BPM / ADF project

In our Oracle BPM/SOA project we initially started with 1 process which had a service call out to Oracle UCM/WCC. Since WCC uses basic authentication by default we enabled an OWSM policy on the external reference and made sure the username and password were set in the composite.xml. With the help of Oracle config plans we were able to transfer the SCA through the different OTAP environments.


<interface.wsdl interface="http://www.stellent.com/CheckIn/#wsdl.interface(CheckInSoap)"/>
<binding.ws port="http://www.stellent.com/CheckIn/#wsdl.endpoint(CheckIn/CheckInSoap)" location="oramds:/apps/rubix/references/UCM.wsdl" soapVersion="1.1">
<wsp:PolicyReference URI="oracle/wss_http_token_client_policy" orawsp:category="security" orawsp:status="enabled"/>
<property name="oracle.webservices.auth.password" type="xs:string" many="false" override="may">welcome2</property>
<property name="oracle.webservices.auth.username" type="xs:string" many="false" override="may">ucmuser</property>

However when there became more and more processes, with increased complexity and all with numberous callouts to backends with authentication enabled, the delivey of our release through the OTAP environment became more complex as well.Besides that, our Oracle ADF task screens needed connection to many of the same endpoints as well so we ended up with username and password properties in that deployment as well.

So to centralize the username and password in our environment we decided to use the full potential of the Oracle Credential Store Framework (CSF) for both BPM and ADF. Oracle CSF is part of the Oracle Platform Security Services (OPSS).

Since Oracle BPM relies heavily on the SOA-INFRA structure used by Oracle SOA Suite the functionality works identical. Lucky for us Edwin Biemond already blogged about this feature regarding Oracle SOA Suite which we could simple re-use for Oracle BPM.

Oracle Credential Store Framework

Next step was Oracle ADF where our task has functionality to call web services which have the same basic authentication. Again we have a quick start by using this blogpost from Wilfred van der Deijl. In this blogpost he explains how to use a key to the credential store and how to retrieve it from your ADF application.

ADF and Oracle Credential Store

With the help of these 2 fellow Dutch Oracle techies blogs this turned out to be the smoothest user story in our last sprint ;-)

References:

Advertisements
 
2 Comments

Posted by on 19-11-2013 in ADF, BPM, Oracle, SOA Suite

 

Tags: , , , , , ,

Using basic authentication for Oracle BPM service call

In our Oracle BPM 11.1.1.6 process we need some calls to Oracle UCM/WCC. Since UCM requires basic authentication we need to make sure the BPM process sends a token.

So in our composite we right-click the UCM webservice reference, select configure WS policies,

Composite

We select the oracle/wss_http_token_client_policy from the security list.

ConfigurePolicies

Now there are multiple ways options to configure the username + password:

  • In JDeveloper we can configure the default value (handy for quick DEV deployments)

We need to configure a binding property, however the thing is that the oracle.webservices.auth properties are not there in the LOV.

ConfigurePolicies_LOV

However if we go to the composite source we can just manually add both
oracle.webservices.auth.username
oracle.webservices.auth.password


  <reference name="sourceUCM" ui:wsdlLocation="CheckIn.wsdl">
    <interface.wsdl interface="http://www.stellent.com/CheckIn/#wsdl.interface(CheckInSoap)"/>
    <binding.ws port="http://www.stellent.com/CheckIn/#wsdl.endpoint(CheckIn/CheckInSoap)"
                location="CheckIn.wsdl" soapVersion="1.1">
      <wsp:PolicyReference URI="oracle/wss_http_token_client_policy"
                           orawsp:category="security" orawsp:status="enabled"/>
      <property name="oracle.webservices.auth.username" type="xs:string" many="false" override="may">weblogic</property>
      <property name="oracle.webservices.auth.password" type="xs:string" many="false" override="may">welcome1</property>
    </binding.ws>
  </reference>

When deploying the project the settings are automatically set.

  • Through Enterprise Manager (can be used to override the default)

If we navigate to our SOA Composite -> Dashboard tab ->  Services and References you can find a list of all webservice references.Click on it and go to the properties tab

Check the HTTP Basic Authentication segment and use this to override any DEV default settings (if necessary)

EM_Properties

 
Leave a comment

Posted by on 18-01-2013 in BPM, Oracle, SOA Suite, UCM, WCC

 

Tags: , , , , , ,

Using UserName information in the Oracle Service Bus

I was debugging a OSB 11.1.1.5 proxy service which had a OWSM UserName token policy attached to it (read this blogpost how to configure your OSB). When I noticed the $inbound variable had some interesting information which I never noticed before.

The $inbound variable holds a big data-set regarding transport and usually a small data-set regarding security. In a “normal” unsecured proxy services this would result in something like this:

<inbound>
 <con:endpoint name="mySomething" xmlns:con="http://www.bea.com/wli/sb/context">
 <con:service>
 <con:operation>getEmployeeDetails</con:operation>
 </con:service>
<con:transport>
........
</con:transport>
 <con:security>
 <con:transportClient>
 <con:username>anonymous></con:username>
 </con:transportClient>
 </con:security>
 </con:endpoint>
</inbound>

So there is just a transportClient reference which normally just contains the value “anonymous”. Not really interesting.

However in the situation where the proxy service uses the OWSM policy it contains a new messageLevelClient element:

<inbound>
 <con:endpoint name="mySomething" xmlns:con="http://www.bea.com/wli/sb/context">
 <con:service>
 <con:operation>getEmployeeDetails</con:operation>
 </con:service>
<con:transport>
........
</con:transport>
 <con:security>
 <con:transportClient>
 <con:username>anonymous></con:username>
 </con:transportClient>
 <con:messageLevelClient>
 <con:username>weblogic</con:username>
 <con:principals>
 <con:group>AdminChannelUsers</con:group>
 <con:group>Administrators</con:group>
 <con:group>IntegrationAdministrators</con:group>
 </con:principals>
 </con:messageLevelClient>
 </con:security>
 </con:endpoint>
</inbound>

Pretty good information for tracing/logging your service calls.

 
1 Comment

Posted by on 13-01-2012 in OSB, Security, WS-Security

 

Tags: , , ,

Oracle Service Bus 11g Development Cookbook

Received the great news today from our publisher Packt that the product page for our Oracle Service Bus 11g Development Cookbook is now officially online.

 
2 Comments

Posted by on 01-11-2011 in OSB

 

Tags: , ,

Oracle SOA Suite Error – Cannot Locate Policy Manager query/update service

Strange error occurred in on of our test environments. Through the Enterprise Manager console we like to configure/check the OWSM configuration but suddenly we receive the error: Cannot locate policy manager query/update service. Policy manager service look up did not find a valid service.

After some checks (network configuration, filled in weblogic listen address, etc) we discovered it was a stupid mistake. Due to some tests with Weblogic Filters in this test domain we actually locked out communication between Admin and SOA managed server. Pretty stupid indeed, but since search engines on this error didn’t find anything interesting it took us some time.

So if you ever get this error, it’s probably due to communication problems between your Admin server hosting EM and the SOA suite Managed Server(s). So check your ip config, network connectivity, weblogic listen addresses and if you use local firewalls (or weblogic filters) check these.

 
2 Comments

Posted by on 24-10-2011 in SOA Suite

 

Tags: , ,

OWSM PolicyManagerException: WSM-02120 [Possible Cause : Destination unreachable]

While attempting to deploy a sbconfig.jar in a new Oracle Fusion Middleware domain with SOA/OSB the deployment could not be activated due to the fact that the OSB SBConsole could not connect to the OWSM Policy framework.

The error message was: [OSB Security OWSM:387177] OWSM Policy oracle/wss_username_token_service_policy is not supported

And sbconsole and logfile showd:
SubSystem: ALSB Console
MessageID: BEA-494002
Message: Internal error occured in OSBConsole : oracle.wsm.policymanager.PolicyManagerException: WSM-02120 : Unable to connect to the policy access service. [Possible Cause : Destination unreachable; nested exception is: java.net.ConnectException: Connection refused: connect; No available router to destination]


The logfiles additionally showed:

SubSystem: oracle.wsm.resources.policyaccess
MessageID: WSM-06108
Message: Error initializing the Oracle WSM Policy Resolver because incorrect configuration is passed

Not fully clear what was wrong so the following checklist was performed:

  • Restarting the Admin / Managed Servers did not resolve the issue.
  • None of the loggings showed any connectivy problems between Admin and the Managed Servers.
  • Network ip configuration was correct for all machines
  • Network communication looked OK for all machines (ping)
  • The “OWSM Policy Support in OSB Initializer Aplication”deployment was Active and correctly targeted (OSB cluster & Admin).
  • The wsm-pm deployment was Active and correctly targeted (OSB & SOA cluster).
  • The mds-owsm datasource was tested and correctly targeted (all)

So as a final I compared the config.xml between a working domain and the domain with the problem.
I expected a difference in one of the OWSM deployments but discovered that the only difference was that the problem-domain had missing Listen Addresses for both Admin and all of the the Managed Servers.

 <server>
    <name>rbx_tst_admin</name>
    <machine>server01</machine>
    <listen-address></listen-address>
    <server-diagnostic-config>
      <name>rbx_tst_admin</name>
      <diagnostic-context-enabled>true</diagnostic-context-enabled>
    </server-diagnostic-config>
  </server>

So in Weblogic Console this was fixed by adding the DNS name of the correct hostname to each Listen Address. (this can be done under Environment -> Servers -> servername -> Configuration -> General -> Listen Address).

Restarting all machines and finally the sbconfig.jar deployment succeeded through the SBConsole.

Conclusion:

  • Apparently the OWSM Framework requires a Listen Address configured for communication between the OSB managed servers and the Admin instance. Other Weblogic and OSB deployments (without OWSM policies) did succeed earlier.

Remarks:

  • Weblogic documentation states: Do not leave the listen address undefined on a Windows computer that uses multiple IP address (a multihomed computer). On such a computer, the server will bind to all available IP addresses.
  • In our case our servers where not multihomed, but we do use VMWare instances with Windows.
 
5 Comments

Posted by on 29-08-2011 in OSB, Weblogic

 

Tags: , , ,

Using OWSM UsernameToken for authentication and authorisation of OSB services

With the use of Oracle Web Service Manager (OWSM) we can easily configure Oracle Service Bus (OSB) services with different message security polices. This configuration can be done from Eclipse (OEPE), OSB SBConsole or the Enterprise Manager. One of the most common WS-Security mechanismes and therefor also OWSM policies is the UsernameToken where a username and password are send along with the message.

In this blog we will:

  • part I: how to enable authentication of users against the list of all known users
  • part II: how to enable authorisation of only a specific subset of users to access a service

First we configure a proxy service in OEPE with the OWSM UsernameToken policy oracle/wss_username_token_service_policy:


And make sure we process the WS-Security header:


After deployment we call the service with a request that is missing the WS-Security to test the result.


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <GreetingRequestMessage>
         <in>I say hello ...</in>
      <GreetingRequestMessage>
   </soapenv:Body>
</soapenv:Envelope>

As expected the result is an error because the OWSM policy requires a WS-Security segment in the SOAP-header which contains a username and password:


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Server</faultcode>
         <faultstring>BEA-386200: General web service security error</faultstring>
         <detail>
            <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
               <con:errorCode>BEA-386200</con:errorCode>
               <con:reason>General web service security error</con:reason>
               <con:location>
                  <con:path>request-pipeline</con:path>
               </con:location>
            </con:fault>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

So to make sure we can send a UsernameToken we add 2 users to the Weblogic security realm called userA and userB.

The request to the proxy service containing the WS-Security UsernameToken for userA


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header>
      <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken wsu:Id="UsernameToken-4" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>userA</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">welcomeA1</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <GreetingRequestMessage>
         <in>I say hello ...</in>
      </GreetingRequestMessage>
   </soapenv:Body>
</soapenv:Envelope>

This results in a successfull response from the proxy service:


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <GreetingResponseMessage>
         <out>HelloWorld</out>
      </GreetingResponseMessage>
   </soapenv:Body>
</soapenv:Envelope>

So part 1 is complete, we succesfully implemented a proxy service that requires a WS-Security UsernameToken and authenticates these users against the Weblogic security realm. But in our case we have a tight security requirement and need to make sure the user is not only authenticated, but also authorized to access this specific service.

The result from part 1 means this is not the case, both userA and userB would be able to access this service. So let’s start part 2 where we will limit the access to the proxy service to only userB. For this we have to login to the sbconsole, since the OEPE does not allow you to make Message (or Transport) Access Control settings.

  • Login the sbconsole
  • Select Project Explorer
  • Select the the proxy service
  • Go to the Security Tab

  • Click on Message Access Control option (either for the whole service or just a single operation).
  • Click on Add Condition
  • Select User from predicate list
  • Type userB at the User Argument Name
  • Click on Add and Finish
  • Click on Save and Activate to finish the OSB session
Next thing we can call the service again and this time with userB and we still receive a succesfull result.
However if we call the service again with a UsernameToken containing userA we get the following SoapFault:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Server</faultcode>
         <faultstring>BEA-386102: Message-level authorization denied</faultstring>
         <detail>
            <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
               <con:errorCode>BEA-386102</con:errorCode>
               <con:reason>Message-level authorization denied</con:reason>
               <con:location>
                  <con:path>request-pipeline</con:path>
               </con:location>
            </con:fault>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

Part 2 is completed and we finished with a proxy service that has both Authentication and Authorization enabled.

Remarks:

  • You can also use groups and roles (rather than users) to authorize access to services.
  • If you implement and configure an external LDAP (like Oracle Internet Directory) in Weblogic you can control ACL with groups central in your company LDAP instead of in each Weblogic security realm.
  • The SOAP fault for Message Level Authorization denied (BEA-386102) contains a faultcode value of “Server” which is not correct if you look at the w3c definition. This should be the value “Client” because: “….. the message could lack the proper authentication or payment information. It is generally an indication that the message should not be resent without change”

Update 2011-08-10:
Added 3rd remark regarding the SOAP Fault code

Update 2012-01-13:
Using the OWSM username token policies you get some additional information on runtime in you $inbound variable. See this blogpost for more details.
References:


 
26 Comments

Posted by on 09-08-2011 in OSB, WS-Security

 

Tags: , , ,