Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. If you want to specify an existing sequence for a result, click Referring Sequence for that result and select the sequence from the registry.
  2. If you want to define the sequence in the tree, leave In-Lined Sequence selected.
  3. Click Update.
  4. In the tree, click the first result node whose sequence for which you want to define inlinethe sequence, and then add the appropriate mediators to create the sequence. Repeat for each result node whose sequence you are defining inline.
Info
titleNote

You can also configure the Mediator using XML. Click switch to source view in the Mediator window.

...

In the following example, the remote service WSO2 Identity Server (with log in URL  https://localhost:9443/services) is see to authenticate the user invoking the secured backend service.

If the authorization test performed on a request sent to this URL fails, the Fault mediator converts the request into a fault message giving Unauthorized as the reason for the request to be rejected and XACML Authorization Failed as the detail. The Property mediator is used to add Then the Respond mediator sends the converted message as a response to the proxy configuration. The Header Mediator is used to remove the To header. The response is then sent via the Send Mediatorback to the client.

If the user is successfully authenticated, the request is sent using the Send Mediator to the endpoint with the http://localhost:8281/services/echo"/ URL.

Code Block
languagehtml/xml
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="EchoProxy"
       transports="https"
       startOnLoad="true"
       trace="disable">
   <description/>
   <target>
      <inSequence>
         <entitlementService remoteServiceUrl="https://localhost:9443/services"
                             remoteServiceUserName="admin"
                             remoteServicePassword=
"enc:kuv2MubUUveMyv6GeHrXr9il59ajJIqUI4eoYHcgGKf/BBFOWn96NTjJQI+wYbWjKW6r79S7L7ZzgYeWx7DlGbff5X3pBN2Gh9yV0BHP1E93QtFqR7uTWi141Tr7V7ZwScwNqJbiNoV+vyLbsqKJE7T3nP8Ih9Y6omygbcLcHzg="
                             callbackClass="org.wso2.carbon.identity.entitlement.mediator.callback.UTEntitlementCallbackHandler"
                             client="basicAuth">
            <onReject>
               <makefault version="soap12">
                  <code xmlns:soap12Env="http://www.w3.org/2003/05/soap-envelope"
                        value="soap12Env:Receiver"/>
                  <reason value="UNAUTHORIZED"/>
                  <node/>
                  <role/>
                  <detail>XACML Authorization Failed</detail>
               </makefault>
               <property name="RESPONSE" value="true"/>
               <header name="To" action="remove"/>
               <send/><respond>
            </onReject>
            <onAccept>
               <send>
                  <endpoint>
                     <address uri="http://localhost:8281/services/echo"/>
                  </endpoint>
               </send>
            </onAccept>
            <obligations/>
            <advice/>
         </entitlementService>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <publishWSDL uri="http://localhost:8281/services/echo?wsdl"/>
   <policy key="conf:/repository/axis2/service-groups/EchoProxy/services/EchoProxy/policies/UTOverTransport"/>
   <parameter name="ScenarioID">scenario1</parameter>
   <enableSec/>
</proxy>