Log in
POST
/api/v1/auth/login
const url = 'http://localhost:8080/api/v1/auth/login';const options = { method: 'POST', headers: {'X-Brokerium-Request': '1', 'Content-Type': 'application/json'}, body: '{"username":"example","password":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/api/v1/auth/login \ --header 'Content-Type: application/json' \ --header 'X-Brokerium-Request: 1' \ --data '{ "username": "example", "password": "example" }'Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”X-Brokerium-Request
required
string
Required on every non-GET request.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
username
required
string
password
required
string format: password
Example generated
{ "username": "example", "password": "example"}Responses
Section titled “Responses”Session created; the cookie is set as well.
Media typeapplication/json
object
user
required
object
id
required
string
username
required
string
role
required
string
disabled
required
boolean
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
token
required
string
expiresAt
required
string format: date-time
Example
{ "user": { "role": "admin" }}Error.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example generated
{ "error": { "code": "example", "message": "example" }}Too many failed logins for this user from this address (too_many_attempts).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example generated
{ "error": { "code": "example", "message": "example" }}Headers
Section titled “Headers”Retry-After
integer
Seconds until the next attempt is accepted.
Apache®, Apache Kafka® and Kafka® are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries. Brokerium is not affiliated with, endorsed by, or sponsored by the Apache Software Foundation.