API Usage
Nevis ID provides REST and SOAP APIs for various use cases.
This page describes the API access model for the Nevis ID cloud product. The APIs are exposed on an own domain. Each environment uses a different domain.
- for the
LIVEenvironment use:https://api.{instance}.getnevis.net, - for other environments use:
https://api-{environment}.{instance}.getnevis.net
On these domains, all API endpoints of the deployed Nevis components are exposed.
In these EXAMPLE project these are:
- nevisIDM
- nevisMeta
- management console
API documentations can be found in the API Docs section.
The API has to be called with a Bearer token in JWT format which has to be created first.
API Creation
Ensure there is a
Device Password Policyin the nevisIDM ClientAPI. If missing, create such a policy with the following configuration:minLength=32
checkDictionary=false
maxLength=100
minNonAlnum=0
minNonLetter=0In the client API Key create a new user, you can use whatever login ID you want, but it is recommended to adhere to consistent naming standards (eg.: api-insert_name).
- Ensure the created user is a technical user.
- Fill out name and e-mail address if required.
Open the default profile and add the IDM Role SoapTechAccess and restrict it to the Default client. This limitation is meant as a safeguard and is recommended for all standard technical users.
Go back to the user.
Create a random 64 character secret:
python3 -c "import secrets; print(secrets.token_urlsafe(48))"
# => 6LFQjP86HDFsv-jQgEyFnUNjECriMZoblEsrkFofCbiLmqDojJ8xjFm5hj78yLPk
For the new technical user created in step 2, create a new credential:
- Type: Device Password
- Policy: Policy created above
- New value and confirmation: The value generated in step 5 (6LFQjP8…)
- Save the created credential
Get the user ext ID, and credential ext ID.
Create the bearer token by combining {userExtId}:{credExtId}:{randomSecret}
echo -n '1054:1024:6LFQjP86HDFsv-jQgEyFnUNjECriMZoblEsrkFofCbiLmqDojJ8xjFm5hj78yLPk' | \
base64 | tr -d '='
# => MTA1MjoxMDQ1OjVUMkRRSXY4a0Y0QWxjeVN5VVBkVThRRzFpTlB4YUJOUXpOeEFvWkFoVWNkWHFVVGVHeXE0amRiV255T1dvTnE
- API Token created.
Nevis SecToken
With the nevisIDM and nevisMeta REST services (“idm-rest” and “meta-rest” patterns) there is a “Nevis SecToken” pattern assigned. The userId in the SecToken will be the userId of the nevisIDM user that the Bearer token is associated with.
Example REST API queries
nevisIDM
$ curl -X GET "https://api.abc123.getnevis.net/nevisidm/api/oic1.0/userinfo"
-H "Authorization: Bearer {your token}"
{"sub":"1389"}
nevisMeta
$ curl -X GET "https://api.abc123.getnevis.net/nevismeta/rest/v2/modules/oauthv2/setups" \
-H "Authorization: Bearer {your token}"
{
"setupIds" : [ "00000000000000000000000000000000" ]
}
Management Console
$ curl -X GET "https://api.abc123.getnevis.net/nevisadmin/api/v1/me" \
-H "Authorization: Bearer {your token}"
{
"userKey" : "admin",
"email" : "[email protected]",
"type" : "local"
}