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