Log in with OSP
POST
/auth/login
const url = 'https://localhost:3000/api/v1/auth/login';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"osp":"7a3b9c4d8e2f1a6b"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://localhost:3000/api/v1/auth/login \ --header 'Content-Type: application/json' \ --data '{ "osp": "7a3b9c4d8e2f1a6b" }'Authenticates with a One-Shot Password and returns JWT tokens
Request Body
Section titled “Request Body”Credentials
Media typeapplication/json
object
osp
required
string
Example
7a3b9c4d8e2f1a6bResponses
Section titled “Responses”Login successful
Media typeapplication/json
object
access_token
required
string
expires_in
required
integer
refresh_token
string
Example
{ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "expires_in": 900, "refresh_token": "a1b2c3d4e5f6g7h8i9j0..."}Invalid request
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Credentials invalides
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}Erreur interne
Media typeapplication/json
object
error
required
string
message
string
Example
{ "error": "invalid_request", "message": "Invalid request body"}