Replies: 2 comments
-
Hi @afroz1 - I can recreate this error, but I have to provide credentials that I know are invalid. When I provide valid credentials, the sample behaves as expected. If you try this command with debugging enabled, do you see anything in the authentication request that points to the issue?
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
When I execute the script, I encounter an 'invalid bearer token' error. However, another script works fine using the same Client ID and Secret. Could you please help me identify what might be going wrong?
falconpy/samples/user_management# python3 get_user_grants.py -k FALCON_CLIENT_ID -s FALCON_CLIENT_SECRET
Process start (2024-12-18 09:49:13.404725, FalconPy v1.4.6)
Traceback (most recent call last):
File "get_user_grants.py", line 201, in
process_tenant(parsed)
File "get_user_grants.py", line 141, in process_tenant
id_list, grant_list = get_grant_data(users)
File "get_user_grants.py", line 71, in get_grant_data
user_lookup = sdk.query_users(limit=500, offset=offset)
File "/usr/local/lib/python3.8/dist-packages/falconpy/_util/_functions.py", line 198, in factory
raise api_error
File "/usr/local/lib/python3.8/dist-packages/falconpy/_util/_functions.py", line 187, in factory
created = func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/falconpy/user_management.py", line 548, in query_users
return process_service_request(
File "/usr/local/lib/python3.8/dist-packages/falconpy/_util/_functions.py", line 703, in process_service_request
return service_request(**new_keywords)
File "/usr/local/lib/python3.8/dist-packages/falconpy/_util/_functions.py", line 250, in service_request
return perform_request(proxy=proxy,
File "/usr/local/lib/python3.8/dist-packages/falconpy/_util/_functions.py", line 198, in factory
raise api_error
File "/usr/local/lib/python3.8/dist-packages/falconpy/_util/_functions.py", line 187, in factory
created = func(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/falconpy/_util/_functions.py", line 460, in perform_request
raise havoc
File "/usr/local/lib/python3.8/dist-packages/falconpy/_util/_functions.py", line 414, in perform_request
content_return, returning_content_type = calc_content_return(response,
File "/usr/local/lib/python3.8/dist-packages/falconpy/_util/_functions.py", line 322, in calc_content_return
raise api_error
File "/usr/local/lib/python3.8/dist-packages/falconpy/_util/_functions.py", line 316, in calc_content_return
raise APIError(code=resp.status_code, message=_message, headers=resp.headers)
falconpy._error._exceptions.APIError: ERROR: access denied, invalid bearer token
Beta Was this translation helpful? Give feedback.
All reactions