Difficulty Authenticating API Requests via Swagger (Netwrix Identity Manager/Usercube) - Accepted values for Principal.Identity.AuthenticationType?

Hello,

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?

Thank you in advance for your help.

Best regards,

Thierry

Hello Thierry,

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.

1 Like

Hello Kamil,

Thank you for your answer. Maybe, it doesn’t work in our development environment because we have chosen to activate AllowLocalLogin & TestUserStore.

I opened a ticket to get help from support.

Thierry

Bonjour Thierry,

Comme l’a indiquĂ© Kamil, lorsque vous accĂ©dez au swagger, NIM utilise les identifiant de l’utilisateur connectĂ©.

Pourriez vous poster le message d’erreur reçu lorsque vous exĂ©cutez un appel API ?

En attendant, vous pouvez utiliser la collection Postman attachée.

Il suffit de remplacer les variables dans la collection par les votre.

NIM.postman_collection.json (4,0 Ko)

Cordialement

Hazem

2 Likes

Bonjour merci pour ce retour.

Voici en piĂšce jointe l’erreur 403 quand j’utilise swagger alors que je suis connectĂ© en admin sur le navigateur.

J’ai ouvert un incident et le support a confirmĂ© le problĂšme, j’attends le retour. Je suis Ă©tonnĂ© que cela ne fonctionne pas que dans notre environnement.

Bonne journée

Thierry

1 Like

Bonjour,

Ceci est un problĂšme de permission.

Pour des raisons de sécurité, les accÚs via les API nécessitent des permissions explicitent sur les objets.

En attendant un correctif ou une procédure plus détallée, je peux vous proposer le contournement suivant :

  1. Identifier la permission manquante
    On peut la retrouver au niveau de l’URL.
    Exemple : pour Agent, l’URL d’appel “http://localhost:5000/api/Connectors/Agent
”.
    La permission manquante “/Connectors/Agent”

  2. Ajouter la permission au profil Administrateur
    Ajouter l’AccessControlRule suivante :

    *<Entry Permission="**/Connectors/Agent/Query**" CanExecute="**true**"/>*
    


    Note : 3 points importants :
    1- EntityType=“Agent” : pour dĂ©finir l’objet de l’appel API
    2- Permission=“/Connectors/Agent/Query” : la permission identifiĂ©e + le type d’action (Query, Create, Update, Delete)
    3- CanExecute=“true” : autoriser l’appel API

  3. Effectuer l’appel API
    Dans le champ squery lister les attributs à retourner avec le “select”
    Dans le champ Path copier la permission dĂ©finie dans l’AccessControlRule

3 Likes

The Path parameter in the API is a mandatory field.
You can find them all here:
References: Permissions | Netwrix Product Documentation

Thank you for your answer, when I add the permission to the administrator profil and complete the path field, it is ok, I get return code 200.

Thank you very much

Thierry

1 Like