cURL
curl --request GET \ --url https://api.example.com/users/me \ --header 'Content-Type: application/json' \ --data ' { "email": "<string>", "password": "<string>" } '
{ "id": 123, "username": "<string>", "email": "<string>", "password": "<string>", "role": "<string>" }
ROLE_USER
Authorization: Bearer <jwt_token> Content-Type: application/json
curl -X GET http://localhost:8080/users/me \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "email": "[email protected]", "password": "NorUs1234" }'
{ "id": 2, "username": "normal-user", "email": "[email protected]", "password": "$2a$10$zAjODzgBZhCuL80b1OT51.jpYuOB8WmwqZ/u9ls4Xf7r0.7Vh9.jy", "role": "ROLE_USER" }
{ "message": "Error de validacion", "statusCode": 400, "errors": [ "Email is required", "Password is required" ] }
{ "error": "Unauthorized", "message": "Authentication failed" }
{ "error": "Forbidden", "message": "Access denied" }
curl -X POST http://localhost:8080/auth/login \ -H "Content-Type: application/json" \ -d '{ "email": "[email protected]", "password": "NorUs1234" }'
token