Skip to content

OAuth2

The OAuth2 service collection provides operations for managing OAuth2 access tokens used to authenticate with the CrowdStrike API. All API requests require a valid bearer token generated through this collection. Use these operations to generate new access tokens and revoke previously issued tokens before their standard 30-minute expiry.

LanguageLast Update
Pythonv1.3.2
PowerShellv2.2.9
Gov0.20.0
TypeScriptv0.6.0
Rustv0.7.0
Rubyv1.2.0
OperationDescription
oauth2RevokeToken
revoke
Revoke a previously issued OAuth2 access token before the end of its standard 30-minute lifespan.
oauth2AccessToken
token
Generate an OAuth2 access token

Revoke a previously issued OAuth2 access token before the end of its standard 30-minute lifespan.

POST /oauth2/revoke
Consumes · Produces application/x-www-form-urlencoded application/json
PEP 8 revoke
NameTypeData typeDescription
dataformDatastringFull data payload in JSON format containing the OAuth2 access token you want to revoke.
client_idformDatastringAPI client ID for the access token you want to revoke. Not Required
tokenformDatastringThe OAuth2 access token you want to revoke.
from falconpy import OAuth2
falcon = OAuth2(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response = falcon.revoke(client_id="string", token="string")
print(response)

Generate an OAuth2 access token

POST /oauth2/token
Consumes · Produces application/x-www-form-urlencoded application/json
PEP 8 token
NameTypeData typeDescription
dataformDatastringFull data payload in JSON format containing your API credentials. CID scoping can also be provided here.
from falconpy import OAuth2
falcon = OAuth2(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response = falcon.token(client_id="string",
client_secret="string",
member_cid="string")
print(response)