Technical Tip: Collection of Postman API request to FortiSOAR with API Key/HMAC(Appliances)/Login authentication
- April 12, 2024
- 0 replies
- 1002 views
| Description | This article describes that when sending an API request to FortiSOAR, it is necessary to authenticate it. Several authentication methods are available:
Fortinet Document Library - FSR HMAC Authentication explains the concept of creating an Identifier and proposes some sample PHP and Python scripts but Postman pre-script language is Javascript. |
| Scope | FortiSOAR, API, Postman. |
| Solution | Here is a Postman collection of API requests to FortiSOAR organized by folders depending on the authentication mechanism. Just download the collection + environment variable files and import them into Postman. The HMAC folder includes APIs with the pre-script in javascript.
Here is the Javascript available in the pre-script tab of HMAC-based authenticated requests:
// //Get URI and replace any {{my_var}} with the relevant value // Build the timestamp value YYYY-MM-DD HH:MM:SS // Get the verb // Build the HASHED Payload and X-CS-Data Header // Build the HMAC256 Fingerprint // Build the Authorization Header // For debug only. Please uncomment to see some values |
