I am trying to integreate with OneLogin SSO, and in our app we have a system of enabling / disabling users. We would like to set that status also on OneLogin so user cannot log in there either after his account has been disabled.
The only thing is - i can't find a proper API endpoint to do this. When im doing it on admin panel (flip user 'active' switch) and save it, then call users API, i get
GET https://api.us.onelogin.com/api/1/users
Response:
{
...
'status': 2,
...
}
From documentation i read 1 is active, 2 is suspended, which is fine. Status is the only thing that changes (in API get users result) when i flip the switch on admin. It does exatly what i need - disables user ability to log in.
The problem is that I Cannot set it through API:
PUT https://api.us.onelogin.com/api/1/users/XXXXXX
request body:
{"status": 2}
response:
{
"status": {
"error": true,
"code": 400,
"type": "bad request",
"message": {
"description": "status is an excluded attribute for put request for user",
"attribute": "status"
}
}
}
Im using API version 1, documentation i relied on: https://developers.onelogin.com/api-docs/1/users/user-resource
So the question is: which endpoint do i use to disable / enable user account or change this status? Can it be achieved through API?
