curl --request POST \
--url https://api.example.com/api/Auth/login \
--header 'Content-Type: application/json' \
--data '
{
"Email": "<string>",
"Password": "<string>"
}
'{
"token": "<string>"
}Authenticate a user and receive a JWT token
curl --request POST \
--url https://api.example.com/api/Auth/login \
--header 'Content-Type: application/json' \
--data '
{
"Email": "<string>",
"Password": "<string>"
}
'{
"token": "<string>"
}{
"Email": "[email protected]",
"Password": "miPassword123"
}
Bearer {token} for protected endpoints.{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
{
"message": "E mail o contrasena incorrectos"
}
curl -X POST https://api.huellitas.com/api/Auth/login \
-H "Content-Type: application/json" \
-d '{
"Email": "[email protected]",
"Password": "miPassword123"
}'
const response = await fetch('https://api.huellitas.com/api/Auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
Email: '[email protected]',
Password: 'miPassword123'
})
});
const data = await response.json();
console.log(data.token);
Huellitas.API/Controllers/AuthController.cs:18
DTO: Huellitas.Core/DTO/Auth/LoginDto.cs