Skip to content
Joshua Hiller edited this page Dec 12, 2021 · 16 revisions

CrowdStrike Falcon Twitter URL

Using the OAuth2 service collection

Uber class support Service class support Documentation Version Page Updated

Table of Contents

Operation ID Description
oauth2RevokeToken
PEP 8 revoke
Revoke a previously issued OAuth2 access token before the end of its standard 30-minute lifespan.
oauth2AccessToken
PEP 8 token
Generate an OAuth2 access token

oauth2RevokeToken

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

PEP8 method name

revoke

Content-Type

  • Consumes: application/x-www-form-urlencoded
  • Produces: application/json

Keyword Arguments

Name Service Uber Type Data type Description
data
Service Class Support

Uber Class Support
formData string Full data payload in JSON format containing the OAuth2 access token you want to revoke.
token
Service Class Support

Uber Class Support
formData string The OAuth2 access token you want to revoke.

Usage

Service class example (PEP8 syntax)
from falconpy import OAuth2

falcon = OAuth2(client_id="API_CLIENT_ID_HERE",
                client_secret="API_CLIENT_SECRET_HERE"
                )

response = falcon.revoke(token="string")
print(response)
Service class example (Operation ID syntax)
from falconpy import OAuth2

falcon = OAuth2(client_id="API_CLIENT_ID_HERE",
                client_secret="API_CLIENT_SECRET_HERE"
                )

response = falcon.oauth2RevokeToken(token="string")
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

PAYLOAD = {
    "token": "string"
}

response = falcon.command("oauth2RevokeToken", data=PAYLOAD)
print(response)

oauth2AccessToken

Generate an OAuth2 access token

PEP8 method name

token

Content-Type

  • Consumes: application/x-www-form-urlencoded
  • Produces: application/json

Keyword Arguments

Name Service Uber Type Data type Description
data
Service Class Support

Uber Class Support
formData string Full data payload in JSON format containing your API credentials. CID scoping can also be provided here.

Usage

Service class example (PEP8 syntax)

This example will generate a token using the credentials provided when creating an instance of the Service Class.

from falconpy import OAuth2

falcon = OAuth2(client_id="API_CLIENT_ID_HERE",
                client_secret="API_CLIENT_SECRET_HERE"
                )

response = falcon.token()
print(response)
Service class example (Operation ID syntax)

This example will generate a token using the credentials provided when creating an instance of the Service Class.

from falconpy import OAuth2

falcon = OAuth2(client_id="API_CLIENT_ID_HERE",
                client_secret="API_CLIENT_SECRET_HERE"
                )

response = falcon.oauth2AccessToken()
print(response)
Uber class example

This example demonstrates generating a token that is potentially different than the token generated when you create an instance of the Uber class.

from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

PAYLOAD = {
    "client_id": "string",
    "client_secret": "string",
    "member_cid": "string"
}

response = falcon.command("oauth2AccessToken", data=PAYLOAD)
print(response)

CrowdStrike Falcon

Clone this wiki locally