Authentication
Auth API: /api/bw/v2/auth
API BW version 2
Methods
POST: Generate a JWT using username and password
POST
u
UserPOST
p
PasswordRESULT:
HTTP 200
Authorized{ "done": "JWT genetared", "jwt": "eyJ0eXAiOiJKV1QiLCJhbGc...iWygJOKQ-Nsv0geu5cHLAJUhV1OrTw" }
HTTP 401
Unauthorized{ "fail": "Unauthorized" }
GET: Return authentication status
HEADER
Authorization
Value: “Bearer authBearerString” stringHEADER
Authorization-Bearer
Alternative to Authorization. Value: authBearerString stringSupports “Authorization-Bearer: authBearerString” as an alternative to “Authorization: Bearer authBearerString”
Header name is case-sensitive
RESULT:
HTTP 200
Authorized with status{ "done": "JWT verified", "jwt": { "iss": "proyect", // issuer "iat": 1234567111, // issued at "exp": 1234567999, // expiration "sub": "user" // subject } }
HTTP 401
Unauthorized{ "fail": "Unauthorized" }