By default, Secure API Manager creates a scope named APIManagerScope. You include the scope name in the Authorization Code grant type that the OAuth clients use to call the API. The OAuth2 protocol refers to the application, service, or client as a client.
Process with the following section, if you need to create a different scope. Otherwise, proceed to Restricting Access to APIs with Access Manager Scopes and Roles in the Publisher.
You create an attribute map to control access to the APIs that are available in the Store. The attribute maps allows the Secure API Manager token validator to access the Access Manager user’s roles to ensure that the user has the correct roles to access an API or specific API endpoints.
To create an attribute map in Access Manager:
From the Access Manager Dashboard, click Devices, then select Identity Servers.
Click the Shared Settings tab.
Click New to create a new attribute map.
Specify a unique name that you can remember and that you associate with Secure API Manager, such as ForSAPIMAllUserRoles.
Click Finish.
Select Support WSTrust and Oauth, then click Next at the end of the page.
Click New to add an attribute definition to the map.
Select Local attribute, then select All Roles.
Click OK to save the attribute map entry, then click Finish to complete the creation of the attribute map.
You create a scope for one or more APIs or API endpoints that you want to protect with Access Manager. You can use the same scope for multiple APIs or for specific API endpoints that cross multiple APIs in Secure API Manager.
From the Dashboard in Access Manager, click the Identity Server cluster you associated with the API Gateway cluster.
Click the OAuth and OpenID Connect tab.
On the menu, click Resource Servers.
Create a new resource server for the APIs or API endpoints as follows:
Add a scope to each resource server for the APIs or API endpoints as follows:
On the Resource Server page, click the name of the appropriate resource server.
Click Scopes.
Click New.
Specify a scope name and description. Ensure that you use something that represents the APIs or API endpoints.
Click User Attributes, then select the Require user permission option. Ensure that you select this option, otherwise the integration fails.
Click Next at the end of the page.
On the Step 2 page, select the attribute map you created in Step 4.
Click Finish at the end of the page.
Repeat Step 5.a through Step 5.h for each scope that you need to create for each resource server.
Update the Identity Server cluster with the new resource servers and scopes as follows:
From the Dashboard, click Devices > Identity Servers.
In the Status column, click Update All.
Click OK.
Update Secure API Manager to have the roles and scopes appear as follows:
From the Access Manager Dashboard, click the appropriate API Gateway cluster.
Click Actions > Update All.
(Optional) Create any role policies that might be required for API access. The set of roles that the API developers see in the Publisher comes from the list of all configured role policies in Access Manager.