Configure a consumer authentication policy

Updated at:

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

Important

After you enable consumer authentication, you must attach consumer authorizations to the API. Otherwise, the API cannot be accessed.

  1. You can configure routing policies across all instances or for a specific instance.

    APIs outside an instance

    1. 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.

    2. 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.

    3. In the Routes list, select the target route.

    APIs inside an instance

    1. 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.

    2. On the Instance page, click the target gateway instance ID. In the left-side navigation pane, choose API, and then click the target API.

    3. Click Create Route.

  2. On the Consumer certification tab, click Configuration Information next to Edit. Turn on the Status switch and select an Authentication Method.

    Important

    After 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.

    Important

    For 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.

  3. 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