Advertisements

Thursday, August 10, 2017

AIA:Implementing wss-username-token (http basic authentication)

In this example I'll show you how to enable a web service security to your AIA artifacs.

To show you this I'll use an EBF component.

These are the high level steps:

1.- Create an user in weblogic console (this user is the one we can provide to any who wants to consume our service)

2.- Enable or make sure is ON the following web service policy AIA_EBF_WSServicePolicySet

3.- Restart the SOA instance.

4.- Test it.

Ok here are the steps in details.

1.- Create an user in weblogic console

  • Log in into the weblgic console and go to "Security Realms".
  • Select "myrealms"
  • Create a new user (in my case I created testusr)



2.- Enable or make sure is ON the following web service policy AIA_EBF_WSServicePolicySet

Log in into EM and go to "Weblogic Domain/your soa domain".
Right click in "your soa domain" and go though the menu to "Web Services/Policy Set"

Image goes here

Select the policy AIA_EBF_WSServicePolicySet and click the button "Edit"



<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tes="http://xmlns.oracle.com/Test/TestSecurityNotProducer">
      <soapenv:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken>
            <wsse:Username>weblogic</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">qwerty12</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <tes:process>
         <tes:input>Hello</tes:input>
      </tes:process>
   </soapenv:Body>
</soapenv:Envelope>


Si se modifican los policy set hay que reiniciar el servidor para que se actualizen los cambios.

No comments:

Post a Comment