Tech Tip: Using Postman to test On REST authentication database method
PRODUCT: 4D | VERSION: 18 | PLATFORM: Mac & Win
Published On: May 20, 2020
When editing the On REST Authentication database method, it is highly recommended to test the response using Postman.
First, create a POST request to http://YOUR_IP_ADDRESS/rest/$directory/login which will trigger the database method. To send credentials, and add the two headers: username-4D and hashed-password-4D. The request should look similar to the image below:
Place a TRACE or breakpoint in the On REST Authentication method and you verify that the credentials were sent in the following parameters below:
$1 - Username
$2 - Password/Hashed password
$3 - True if password was hashed, else False
$4 - IP Address of caller
Once that is done, you are now ready to code the rest of the authentication method.