This documentation is for WSO2 API Manager 1.10.0 View documentation for the latest release.
Page Comparison - Adding Mediation Extensions (v.4 vs v.5) - API Manager 1.10.0 - WSO2 Documentation

Versions Compared

Key

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

...

An example synapse configuration of a Per per-API Extension extension sequence created for an API named the API admin--TwitterSearch with version  version 1.0.0 is given bellowbelow.

Code Block
languagexml
<sequence xmlns="http://ws.apache.org/ns/synapse" name="admin--TwitterSearch:v1.0.0--In">
 <log level="custom">
    <property name="TRACE" value="API Mediation Extension"/>
 </log>
</sequence>

...

An example synapse configuration of a Global Extension global extension sequence is given below.:

Code Block
languagexml
<sequence xmlns="http://ws.apache.org/ns/synapse" name="WSO2AM--Ext--In"> 
	<property name="Authentication" expression="get-property('transport', 'Authentication')"/> 
	<property name="Authorization" expression="get-property('Authentication')" scope="transport" type="STRING"/> 
	<property name="Authentication" scope="transport" action="remove" /> 
</sequence>

This custom sequence will assign assigns the value of your basic authentication to Authorization header.

You can copy this content into an xml XML file (e.g., global_ext.xml) and save it in the <API_Gateway>/repository/deployment/server/synapse-configs/default/sequences directory.

When you invoke your REST API via a REST Client, configure that client to have a custom header (Authentication) for your basic authentication credential and configure the ‘Authorization’ header to contain the bearer token for the API. Then when When you  send the Authentication and Authorization headers, the Gateway will drop drops the Authorization header and convert , converts the Authentication to Authorization header headers and send sends to the backend.