Create a service provider and configure it as an OIDC client application. (1)
Generate the access token using the following command.
curl -u <CLIENT_ID>:<CLIENT_SECRET> -k -d "grant_type=password&username=<USERNAME>&password=<PASSWORD>&scope=<REQUIRED_SCOPE>" -H "Content-Type:application/x-www-form-urlencoded" https://<IS-HOST>:<PORT>/oauth2/token
You have to replace <CLIENT_ID>
, <CLIENT_SECRET>
, <USERNAME>
, <PASSWORD>
, <REQUIRED_SCOPE>
, <IS-HOST>
, <PORT>
accordingly.
More Info: (2)
When adding the required scopes, look at the scopes required section of each endpoint in API definition. For example If you want to generate an access token to use in GET https://<HOST>:<PORT>/api/server/v1/tenants
request's authorization, you should pass internal_list_tenants
as a scope. Also you can pass multiple scopes separated by scapes.
- Use the retrieved access token to authorize the REST endpoint. If you generated the token without passing the required scopes, you will get
403 Forbidden
response from the REST API call. More info (3)