- Perform a 'GET' on Prime's API, and it keeps returning the login HTML, In postman, after setting the Basic Auth, returns 401 Unauthorized. It seems like after login to prime through the GUI, it will work just fine. Even tried in a web browser. set up a new username and password as NBI Read/Write, also tried curl -k -u username:password
- https://your_server/webacs/api/v1/data/InventoryDetails.
Using a self-signed SSL certificate that was not trusted by Chrome. One workaround stumbled upon was to first open Chrome and connect to the GUI to accept the certificate warning, but then left the browser open. After that, all my calls from Postman would succeed - just like you described.
But eventually added the certificate to the trusted list in Chrome. But kept running to this from time-to-time. What discovered is that would run my test with a hostname that matched the CN on the certificate, and other times would be using something else. When the hostname in my API call did not match the CN, the calls would fail with the error you noted.
Try adding the -k option to your curl call and passing the credentials, but the API documentation says it uses Basic Authentication. So you need to add the "--basic" argument to your curl command.
You will want that account to have "NBI Read" and "NBI Write" permission. But if you need the account to also access any API calls that return credentials-related information, you should add it to "NBI Credential", not "Admin". The "Authentication & Authorization" page in the API documentation has a statement on this about "NBI Credential":
"Can access APIs that return device credentials (such as the Credentials Service group) or other sensitive information."
The "Northbound API" is for the "Guest Access API", which is a different API set altogether.
Comments
0 comments
Please sign in to leave a comment.