Alias Management in API Gateway

This article gives an overview of how to use different aliases in API Gateway. 
 

Prerequisites:

1. You must have an active webMethods.io API Gateway tenant. 
2. You must have an API hosted on your webMethods.io API Gateway tenant (SOAP & REST). You can learn more about it here.
 

Types:

This section showcases how to use different aliases in API Gateway with examples.

I. Simple Alias :

                           A simple alias holds simple key property values. The name of the alias can be used in the configuration of the properties of a routing policy or an email destination for the Log Invocation, Monitor Service Level Agreement, Monitor Service Performance, and Throttling Traffic Optimization policies. If someone wants to change the email address in log invocation, here he doesn't need to go to each and every API policy and change the email there. He just needs to change it one time in the alias default value field.
 
1. Login to your webMethods.io API Gateway tenant.
2. Click on the `profile icon` and select `Aliases` from the drop down.
 
3. Now click on `Create alias` button.
 
4. Select `Simple alias` from the drop down and provide the alias a name.
 
5. Provide the `email address` in the default value and `Save` the alias.
6. Now, go back to APIs, select a API. 
 
7. Click `Edit` to edit your API and navigate `Policies`.
8. Now select ` Monitor Service Performance ` under `Traffic Monitoring`.
A screenshot of a cell phone
Description automatically generated
9. Now on the right side window check `Email` and provide the value as ${your_alias_name} and click `Add`
A screenshot of a cell phone
Description automatically generated
10. Put a alert message.
A screenshot of a cell phone
Description automatically generated
 
11. Now click on `Add action configuration`.
A screenshot of a cell phone
Description automatically generated
 
12. Fill the value and `Add` the configuration. Save the API.
 
** Now in each successful invocation of your API, you will get a notification in your email. And if you want to change the email you don't need to edit the API again. Just go to the `Alias` and replace the `Default Value` with the new email. **

II. End Point Alias :

                               An endpoint alias stores the  the default URI or components of the URI such as service name along with additional properties such as connection timeout, read timeout, whether to pass security headers or not, keystore alias, key alias, and so on. 
 
1. Login to your webMethods.io API Gateway tenant.
 
2. Go to APIs, select an API and copy its Native Endpoint. 
 
3. Navigate to `Alias` and create a new alias. Select `Endpoint alias` from the drop down.
 
4. In the `Endpoint URI` paste the coppied native Url and `Save` the alias. 
A screenshot of a social media post
<p>Description automatically generated" class=“WACImage SCXW260359843 BCX9” src=“<a href=//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/techcommunity/original/2X/4/414a4bf2d990c39a755485a89a3e05474303e79d.png”>

 
5. Now, go back to APIs, select the API you had selected in step 2. 
A screenshot of a cell phone
<p>Description automatically generated" class=“WACImage SCXW155914890 BCX9” src=“<a href=//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/techcommunity/original/2X/7/7e91b1d8acfcf376de3df6bf08c98b04502fced1.png”>

 
 
6. Select Edit  to edit your API policies.
A screenshot of a cell phone
<p>Description automatically generated" class=“WACImage SCXW219921224 BCX9” src=“<a href=//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/techcommunity/original/2X/f/f1a8edc794b0bf5643ecf7795a155ea804091274.png”>

 
7. Select Straight Through Routing under Routing. 
A screenshot of a cell phone
<p>Description automatically generated" class=“WACImage SCXW160014590 BCX9” src=“<a href=//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/techcommunity/original/2X/9/95bc928f58710df382a57b4d2ad080c2aae508b8.png”>

 
8. Under Policy Properties, replace the highlighted portion of your Endpoint URI with your alias name. 
 
9. Save the API.
 
** Now if you deploy the API in other stage and you need to change the native URL you dont need to edit the API. Just go to the `Alias` and replace the ` Endpoint URI ` with the new native URL . **
 

III. HTTP transport security alias :

                                                      An HTTP Transport security alias contains transport level security information required while accessing the native API. Transport level security that are supported in API Gateway outbound are as follows:
HTTP Basic authentication
OAuth2 authentication
NTLM authentication
Kerberos authentication
1. Login to your webMethods.io API Gateway tenant.
 
2. Create a alias . Select `HTTP transport security alias` from the drop down and provide the alias a name.
 
3. Click `Technical information`. In the ` Authentication scheme ` field specify the type of authentication you want to use while communicating with the native API. Provide the relevent value and save the alias.
A screenshot of a cell phone
<p>Description automatically generated" class=“WACImage SCXW23212107 BCX9” src=“<a href=//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/techcommunity/original/2X/9/9b5dd7ec967f3a321195793c59bf7699749997fc.png”>

 
4. Now native to `API` and select the API where you want to use `HTTP transport security alias`.
5. Edit your API, go to your `Policy` and select `Routing`, from the drop down select `Outbound authentication `.
6. Now on the right side window select `Alias` from ` Authentication scheme` and select your alias from the drop down. Save the API.
 
** Now you need to pass the authentication each time you send a request to the API. If you want to change authentication just edit the alias .**
 

IV. SOAP message security alias :

                                                       A SOAP message security alias contains message level security information that is requires to access the native API. If the native service is enforced with any WS security policy, API Gateway enforces those policies in the outbound request while accessing the native API using the configuration parameters specified in the alias.
Login to your webMethods.io API Gateway tenant.
Create a alias . Select ` SOAP message security alias` from the drop down and provide the alias a name.
Click `Technical information` and add the relavent details. 
WSS Username. Generates a WSS username token and sends it in the soap header to the native API. 
Kerberos. Fetches a Kerberos token and sends it to the native API. 
SAML. Fetches a SAML token and sends it to the native API.
 
 
Now native to `API` and select the SOAP API where you want to use SOAP message security alias.
 
Now go to your `Policy` and select ` Routing ` , from the drop down select `Outbound Authentication- Message `.
 
Now on the right side window Select `Authentication Sheme` as `Alias` and select your alias name from the drop down. Save the API.
A screenshot of a cell phone
<p>Description automatically generated" class=“WACImage SCXW38113425 BCX9” src=“<a href=//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/techcommunity/original/2X/3/37c6132d73fbedfc3920e08717e67831443e822e.png”>

V. webMethods IS Service alias :

                                                     A webMethods Integration Server service alias holds the IS service value. The name of the alias can be used to invoke the Invoke webMethods IS policy for request and response processing.
 
1. Start your IS server and browse http://localhost:5555/ .
 
2. Navigate to `Webmethods Cloud` and select ` Settings`.
A screenshot of a cell phone Description automatically generated
 
3. Fill up the required details and `Update Settings`.
 
4. Login to your webMethods.io API Gateway cloud tenant.
 
5. Create a alias . Select ` Webmethods IS Service Alias` from the drop down and provide the alias a name.
 
 
6. Click `Technical information` and specify the IS service name in the `Service name` field. Save the alias. 
Note:
The IS service must be available in the Integration Server, to which the aliases are deployed.
 
7. Now native to `API` and select the API where you want to use IS Service.
 
 
8. Now go to your `Policy` and select ` Request Processing ` , from the drop down select `Invoke webMethods IS `.
A screenshot of a cell phone
<p>Description automatically generated" class=“WACImage SCXW81526011 BCX9” src=“<a href=//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/techcommunity/original/2X/c/c6c30903074d02e4d06ac8000f768371514b4ee9.png”>

 
9. Now on the right side window Select your alias name from the drop down. Save the API.
A screenshot of a cell phone
<p>Description automatically generated" class=“WACImage SCXW192605062 BCX9” src=“<a href=//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/techcommunity/original/2X/2/28bb0d427e7c4e292646ed688d9daea8a55a0fb1.png”>

 
** Now this will invoke the get access token service in the IS in request processing. If you want to change the IS service edit the alias and replace the new one. You can configure the same for response processing also**
 

VI. XSLT Transformation alias :

                                                   An XSLT transformation alias holds a list of XSLT style sheets. The name of the alias can be used in the XSLT Transformation policies for request and response processing.
 
1. Login to your webMethods.io API Gateway tenant.
 
2. Create a alias . Select ` XSLT Transformation Alias` from the drop down and provide the alias a name.
 
3. Click `Technical information` and browse and select an XSLT style sheet in the `Select transformation` file field , which you want to use for a perticular API.
 
4. Now native to `API` and select the API where you want to use XSLT transformation.
 
5. (Optional) If the transformation is related to a perticular end-point create a scope
 
6. Now go to your `Policy` and select ` Response Processing ` , from the drop down select `Response Transformation `.
A screenshot of a cell phone Description automatically generated
7. Now on the right side window Click on `Payload Transformation` and click on `Add xslt transformation alias` button.
 
8. Now select the Alias name you have already created from the drop down and click OK and save the API.
 
** Now this will transform your XML response data to JSON and APIGW will send back the data as JSON to the client. If you want to change the XSLT transformation just edit the alias and replace the new .xsl file. You can configure the same for request processing also**