How to pass credentials in a REST URL


Webtrends 9.x


At times, it is useful to create a REST URL that also includes the user credentials. This violates security best practices, instead, pass the credentials in a POST request rather than in a GET request. Theninclude the username and password on the headers of the POST request

Example URL:https://ws.webtrends.com/v3/Reporting/profiles/

Account Name: accountname
Username: username
Password: password

Therequest would be:

POST /v3/Reporting/profiles/ HTTP/1.1
HOST: ws.webtrends.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 49


Note that the “\” that is normally between the account name and user name has to be URL encoded.