Skip to main content

OAuth2

OAuth2 on this clone is custom form HTTP on the REST mux: POST /oauth2/token and POST /oauth2/revoke. Those paths are not IdentityService RPCs.

Console login is a cookie, not OAuth2. CreateSession (POST /identity/entities/sessions/v1) sets HttpOnly cs_console. DeleteSession clears it. GetCurrentUser (GET /identity/combined/user-current/v1) accepts that cookie or Authorization: Bearer with scope user-management:read. RPC field notes: IdentityService.

REST schemas: API reference.

These curls use http://crowdstrike-api.localhost. If you call Compose by IP instead, send Host: crowdstrike-api.localhost — Traefik may listen on :8088.

Seed clients​

client_idclient_secretScope
cs-local-readcs-local-secretuser-management:read
cs-local-hostscs-local-hosts-secrethosts:read

member_cid is accepted on the token form and ignored.

cs-local-hosts (hosts:read) can call Hosts query/get; it cannot PATCH alerts. See Hosts. A token without user-management:read still proves 403 on current user.

Issue a token​

POST /oauth2/token with application/x-www-form-urlencoded client_id and client_secret. Success is 201 JSON (not an MSA envelope): access_token, expires_in 1800, token_type bearer, and scope. Missing fields → 400. Unknown client or bad secret → 403.

curl -H 'Content-Type: application/x-www-form-urlencoded' \
-d 'client_id=cs-local-read&client_secret=cs-local-secret' \
http://crowdstrike-api.localhost/oauth2/token
curl -H 'Content-Type: application/x-www-form-urlencoded' \
-d 'client_id=cs-local-hosts&client_secret=cs-local-hosts-secret' \
http://crowdstrike-api.localhost/oauth2/token

Call current user with Bearer​

TOKEN='<access_token from cs-local-read>'
curl -H "Authorization: Bearer ${TOKEN}" \
http://crowdstrike-api.localhost/identity/combined/user-current/v1
  • Token from cs-local-read (user-management:read) → 200
  • Token from cs-local-hosts (hosts:read only) → 403
  • Missing or revoked token → 401

Revoke a token​

POST /oauth2/revoke with HTTP Basic client_id:client_secret and form token. Success is 200 MSA with empty resources. Unknown token is still 200. Missing token → 400. Bad Basic auth → 403.

TOKEN='<access_token>'
curl -u 'cs-local-read:cs-local-secret' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d "token=${TOKEN}" \
http://crowdstrike-api.localhost/oauth2/revoke

After revoke, the same Bearer GET /identity/combined/user-current/v1 returns 401.