HMAC-SHA256 method to calculate the request signature

Hello, I’m trying to use the HMAC-SHA256 method to calculate the request signature, but I can’t figure out how. These are the instructions I have:

Each request must contain a minimum of 3 parameters required for authentication: user, institutionID, signature.

Signature calculation:

institutionID + CRLF
RequestURI + CRLF

signature = HMAC-SHA256(data, password)

  • institutionID: institution ID in the system
  • RequestURI: requested resource (ex: “/users/”)
  • Date: CEST (UTC+2), in format YYYY-MM-DD HH:ii (current: 2023-02-13 20:19)
  • CRLF: Carriage return (char(13)) + Line feed (char(10))

Thanks in advance.

Hey there!

This request shows you how to encrypt and decrypt parameters using HMAC-SHA256:

I’m not too sure about the rest of your instructions as they don’t seem specific to Postman, try to get it working in there and then let us know what issues you are facing. :slight_smile:

Thanks for the help, but I can’t figure out how to do it without getting the authorization faild error.

I have an example in Php of how to get the signature, if that helps:

$data =	'GET' . "\r\n" .
	'999' . "\r\n" .
	'/users' . "\r\n" .
	'2022-12-31 23:59';
$signature = hash_hmac('sha256', $data, 'password');

where is 999 - institution ID.

And the request should look like this: