Configure a consumer authentication policy
Cloud-native API Gateway supports route-level authentication using API keys, JSON Web Tokens (JWTs), or Hash-based Message Authentication Codes (HMACs). Consumer authentication policies let you control API access, enforce fine-grained multitenancy, isolate sensitive data, and prevent unauthorized access.
Procedure
After you enable consumer authentication, you must attach consumer authorizations to the API. Otherwise, the API cannot be accessed.
-
You can configure routing policies across all instances or for a specific instance.
APIs outside an instance
-
Log on to the Cloud-native API Gateway console. In the left-side navigation pane, choose API. In the top menu bar, select a region.
-
Click the target API. From the drop-down list, select the desired instance, or select All instances. Click the HTTP API tab, and then select the target instance from the All Instances drop-down list.
-
In the Routes list, select the target route.
APIs inside an instance
-
Log on to the Cloud-native API Gateway console. In the left-side navigation pane, choose Instance. In the top menu bar, select a region.
-
On the Instance page, click the target gateway instance ID. In the left-side navigation pane, choose API, and then click the target API.
-
Click Create Route.
-
-
On the Consumer certification tab, click Configuration Information next to Edit. Turn on the Status switch and select an Authentication Method.
ImportantAfter you change the consumer authentication configuration, you must republish the API for the changes to take effect.
Parameter
Description
Status
When enabled, the authentication policy takes effect.
ImportantFor published APIs or routes, first attach the consumer authentication policy. After the authorization is complete, enable the policy.
Authentication Method
The authentication method for consumers of the current API. Supported methods: API key, JWT, and HMAC.
-
In the Consumer Name section, click Authorization and select a consumer from the drop-down list. You can also click Manage consumers to create a new one. Finally, click Add.
References
For more information about how to create and authorize consumers, see Manage consumers and Consumer authorization.
For more information about how consumers can securely access through authentication and authorization, see Consumer authentication and authorization.