I am trying to use the Swagger UI capability to test the Netwrix Identity Manager (NIM) APIs, but I am facing difficulty with request authentication.
I attempted to authenticate by setting the following parameters in the request headers (or equivalent fields in Swagger):
Principal.Identity.Name
Principal.Identity.AuthenticationType
Principal.Identity.IsAuthenticated
I specifically tried to set Principal.Identity.AuthenticationType to the value Cookies, but this resulted in a HTTP 500 error (Internal Server Error).
I suspect that the value Cookies is not accepted for this parameter, but I have not been able to find documentation listing the admitted values for Principal.Identity.AuthenticationType.
Could anyone provide some insight or documentation on the accepted values for this specific authentication parameter?
But you don’t need to do any authentication when using the Swagger UI? It will automatically use the credentials of the already logged-in user in another tab. I never had to specifically set credentials to use the Swagger.
I have opened an incident, and support has confirmed the issue. I am waiting for their response. I am surprised that it only doesn’t work in our environment.
For security reasons, access via APIs requires explicit permissions on the objects.
While waiting for a fix or a more detailed procedure, I can suggest the following workaround:
Identify the missing permission
It can be found in the URL. Example: For Agent, the call URL “http://localhost:5000/api/Connectors/Agent…”.
The missing permission is “/Connectors/Agent”.
Add the permission to the Administrator profile
Add the following AccessControlRule:
Note: 3 important points:
1- EntityType=“Agent”: to define the object of the API call
2- Permission=“/Connectors/Agent/Query”: the identified permission + the type of action (Query, Create, Update, Delete)
3- CanExecute=“true”: to allow the API call
Perform the API call
In the squery field, list the attributes to return with the “select”.
In the Path field, copy the permission defined in the AccessControlRule.