One Login Test Cases

The base url for the API varies by region. Use the region that your OneLogin account resides in.

 

Step-1

Generate One Login Client ID and Secrets

Go to, Developers Tab > API Credentials > Click New Credentials

Make sure to save Client ID and secrets in safe place

Name: Groups Sync for Jira Cloud

Choose Read all

Click Save.

 

Step-2

Generate One Login Access Token using above Client ID and Secrets.

$ curl "https://api.us.onelogin.com/auth/oauth2/v2/token" -X POST -H "Authorization: client_id:*****8b97d64318fe, client_secret:*********78c4a5527ced2" -H "Content-Type: application/json" -d '{"grant_type":"client_credentials"}' {"access_token":"*************e36a8d0e7a00bd93187defd","created_at":"2020-01-28T13:51:43.857Z", "expires_in":36000,"refresh_token":"bd66d859bd484c4d0*******","token_type":"bearer", "account_id":162360}

Take note of access token for below commands.

 

Step-3

Get Custom Attributes

$ curl -XGET -H "Authorization: bearer:*************e36a8d0e7a00bd93187defd" "https://api.us.onelogin.com/api/1/users/custom_attributes" {"status":{"error":false,"code":200,"type":"success","message":"Success"},"data":[[]]}

 

Step-4

Get Users by Group Attribute.

$ curl -XGET -H "Authorization: bearer:*************e36a8d0e7a00bd93187defd" "https://api.us.onelogin.com/api/1/users/?limit=10"

Not sure about APIs

  • How to get group ID by group name

  • How to get users by group ID

If any help from Onelogin team appreciated.