I have read that the public api is only partially supported, but is there a way to query a list of groups? Ultimately, I want to create collections for each group that I have synced using Bitwarden Directory Connector.
I tried a request of GET /api/organizations/<org_id>/groups. But I don’t know how to get past the user authentication. I attempted the following options but none worked.
curl https://$DOMAIN/api/organizations/$ORG_ID -d '{"username":$USER,"password":$PASS}'
curl -X POST https://$DOMAIN/api/organizations/$ORG_ID -H "Content-Type: application/json" \ -d '{ "client_id": "organization.$ORG_ID", "client_secret": $SECRET, "scope": "api.organization", "grant_type": "client_credentials" }'
curl -H "Authorization: Bearer $SECRET" https://$DOMAIN/api/organizations/$ORG_ID
Also, is there a way to show the id of groups in the web ui? I tried creating a collection with the Bitwarden Client but I couldn’t find the id of the group I wanted to specify. I could only find the external id in the web UI so I tried with that and it did not work.
The request JSON I passed to bw
is something like the following:
{"organizationId": $ORG_ID,"name": "TEST", "groups": [{"id": $EXTERNAL_ID, "readOnly": false, "hidePasswords": false, "manage": true}]}