Welcome to the WS Login Service. This service allows clients to authenticate and receive a JSON Web Token (JWT) for accessing other web services. The token includes information about the client and is valid for a limited duration.
curl. After obtaining a token, use the instructions at the end to include the token in future requests.
The service is accessible at the following endpoint:
POST /webservices/rest/ws-login.php
http://mutillidae.localhost/webservices/rest/ws-user-account.php if you intend to call that service.Here is how to send a request to the login service using Burp Repeater:
POST /webservices/rest/ws-login.php HTTP/1.1
Host: mutillidae.localhost
Content-Type: application/json
Origin: http://mutillidae.localhost
{
"client_id": "your-client-id",
"client_secret": "your-client-secret",
"audience": "http://mutillidae.localhost/webservices/rest/ws-user-account.php"
}
Instructions:
curlIf you prefer using the command line, here’s how you can make the same request with curl:
curl -X POST "http://mutillidae.localhost/webservices/rest/ws-login.php" \
-H "Content-Type: application/json" \
-d '{
"client_id": "your-client-id",
"client_secret": "your-client-secret",
"audience": "http://mutillidae.localhost/webservices/rest/ws-user-account.php"
}'
Instructions:
curl command.If everything works correctly, you will receive a response like this:
{
"access_token": "your-jwt-token",
"token_type": "bearer",
"expires_in": 3600
}
After obtaining the token, include it in the Authorization header for any further requests to secured endpoints. Below are examples of how to do this with both curl and Burp Repeater.
Make a request to an authenticated endpoint (e.g., ws-user-account) using curl:
curl -X GET "http://mutillidae.localhost/webservices/rest/ws-user-account.php" \
-H "Authorization: Bearer your-jwt-token"
To include the JWT token in Burp Suite:
GET /webservices/rest/ws-user-account.php HTTP/1.1
Host: mutillidae.localhost
Authorization: Bearer your-jwt-token
mutillidae.localhost host is correctly configured in your environment.401 Unauthorized error, ensure your token is correct and has not expired.Now that you have your JWT token, you can access other authenticated services. Refer to the individual service pages for specific instructions on interacting with each service.