Configuring Access Mode for a Port
The access mode of a port determines whether APIs can be invoked through the port or not. This section explains the steps required to configure the access mode of ports.
You can either allow or deny the access of all APIs through a port. When you allow access of APIs using a port by default, you can specify a list of APIs that must be denied access over the port. Also, if you deny the access of APIs using a port, you can specify a list of APIs that can be allowed to access using the port. This configuration is applicable for REST, SOAP, and OData APIs.
To enable the individual access modes ensure that you have set the following parameters accordingly:
watt.server.portAccess.axis2 = true for SOAP APIs
pg.security.honourPortAccessModeSettings = true for REST and OData APIs
Important:
When performing the following procedure, do not log into the server through the port you want to change, if you are selecting Deny by default. The procedure involves temporarily denying access to all APIs through the port. If you log on through the port you want to change and then deny access to all APIs through it, you will be locked out of the server. Instead, log on through a different existing port or create a new port to log on through.
To configure access mode for a port
1. Expand the menu options icon , in the title bar, and select Administration. 2. Select Security > Ports.
The ports page lists all the ports configured with API Gateway.
3. Click the Accessmode button for the port that you want to configure the access mode.
The options to configure the port access mode are displayed.
4. Select one of the following options:
Allow by default. To allow access of the port, by default.
Deny by default. To deny access of the port, by default.
The port is enabled or denied for access by all APIs.
5. Optional. Perform one of the following:
If you have selected
Allow by default, provide the APIs for which you want to deny access through the port in the
Add APIs to Deny List field and click
+ Add. Repeat this step to add the required APIs to the list. You can also edit or delete the entered values by clicking the respective action next to the required value.
If you have selected
Deny by default, provide the APIs for which you want to allow access through the port in the
Add APIs to Allow List field and click
+ Add. Repeat this step to add the required APIs to the list. You can also edit or delete the entered values by clicking the respective action next to the required value.
To allow or deny access of all versions of an API through a port, specify the API in the following format:
apiName or
apiName/ - For REST and OData APIs
Not possible - For SOAP APIs
To allow or deny access of a particular version of an API through a port, specify the API in the following format:
apiName/version or
apiName/version/ - For REST and OData APIs
/ws/apiName/version - For SOAP APIs
For example, if you select Allow by default and provide calc/1.0/ in Add APIs and services to Deny List, then the 1.0 version of the API Calc is denied to access through the port.
If you specify an API in the apiName/version/ or /ws/apiname/version/ format, then you must invoke the API using the protocol://host:port/ws/apiname/version/ format.
The API names along with their version numbers specified in the Allow and Deny lists must exactly match the required API names.
Note:
Even if an API has custom endpoints, you must provide the apiName and not the custom endpoint paths in the Allow and Deny lists.
6. Click Save.
The changes are saved.
Note:
To enforce this configuration on REST and OData APIs, when accessed through the HTTP and HTTPS ports, set the value of the
pg.security.honourPortAccessModeSettings extended setting as
true. To enforce this configuration on SOAP APIs, set the
watt.server.portAccess.axis2 setting as
true. For information on configuring an extended setting, see
Configuring Extended Settings.
API Gateway services to be exposed for API Portal and client communication
If you have configured port access restrictions to allow access only to the APIs hosted on the API Gateway (say with /gateway/, /ws/ , and so on), then ensure that you also provide access to the following APIs in case the APIs are protected by security policies such as OAuth, OpenId or JWT. Allowing access to these endpoints is important for API Portal and API consumers to access API Gateway to retrieve the tokens.
pub.apigateway.oauth2:getAccessToken
secure.apigateway.oauth2:approve
pub.apigateway.oauth2:authorize
pub.apigateway.oauth2:authorize
pub.apigateway.openid:getOpenIDToken
pub.apigateway.openid:openIDCallback
pub.apigateway.jwt:getJsonWebToken
pub.apigateway.jwt:certs
pub.apigateway.jwt:configuration
pub.apigateway.jwt:thirdPartyConfiguration
Additionally, the following REST API endpoints are exposed by API Gateway, which are required from the API Portal to access API Gateway. This is to ensure that while you only allow required REST API endpoints, API Portal functionalities continue to work without any impact.
API Portal invokes the following two internal APIs of API Gateway:
Token request endpoint (apigateway.accesstokens)
JWT request endpoint (apigateway.jwt:getJsonWebToken)