- Under the Monitoring Resources tab, navigate to the
POST api/v2/sessionsendpoint ("Create a new session"). - Select the row to expand the Swagger interface and select the Try it out button.
- In the Request body section, enter your username and password (user must have
API privileges) in the JSON request body:
{ "username": <API username>, "password": <API password> } - Select Execute.
- The
apiTokenvalue of the JSON response body contains your Basic authenticationapiTokenpassword which will be used to authenticate the Swagger UI session. Copy this value for the next step.{ "id": 87, "type": "UserSession", "apiToken": "JhN8VqEgYFxz/MWfdtz/yblND11X/LWsfalE/Z+V", "apiTokenExpirationDateTime": "2024-11-25T01:01:35Z", "basicAuthenticationCredentials": "YWRtaW46SmhOOFZxRWdZRnh6L01XZmR0ei95YmxORDExWC9MV3NmYWxFL1orVg==", "state": "LOGGED_IN", "remoteAddress": "172.40.100.1", "readOnly": false, "loginDateTime": "2024-11-25T00:41:35Z", "logoutDateTime": null, "response": null, "user": { "id": 3, "type": "User", "name": "admin", "_links": { "self": { "href": "/api/v2/users/3" } } }, "authenticator": { "id": 2, "type": "AddressManagerAuthenticator", "name": "proteusAuthenticator", "_links": { "self": { "href": "/api/v2/authenticators/2" } } }, "_links": { "self": { "href": "/api/v2/sessions/87" }, "collection": { "href": "/api/v2/sessions" } } } - Return to the top of the Swagger UI.
- Select the Authorize button at the top right of the search bar.
- Under basicAuthentication:
- In the Username field, enter your API username.
- In the Password field, enter the
apiTokenvalue retrieved from theapi/v2/sessionsendpoint.
- Select Authorize.
The Swagger UI session is now authenticated.