AWS Cloud9 or Code Editor Environment "[Error 401] access denied, invalid bearer token" when authenticating #1132
Unanswered
b1tf0rbyt3s
asked this question in
Q&A
Replies: 1 comment 10 replies
-
The example above appears to leverage Environment Authentication (manually). If you swap to Direct Authentication, do you get a valid bearer token? |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Was attempting to utilize falconpy from within our AWS coding environment. Tried creating a Cloud9 environment with both the Amazon Linux and Ubuntu 22 EC2 underlying it. When I try to run any calls I get a [Error 401] access denied, invalid bearer token. Cloud9 comes default with Python 3.9.16 when using Amazon Linux OS and 3.10 when using Ubuntu 22. I even tried upgrading to 3.12 to see if there was any difference. I also tried using Code Editor from within AWS SageMaker and it defaults to python 3.10 - get exact same error.
What is puzzling is that the same exact code works fine when running within my local IDE on my laptop, utilizing same python versions. Makes me think it is something within the AWS environment that is not allowing authentication but not sure how to pinpoint the exact issue as it only gives me a "access denied, invalid bearer token" error.
Sample test code to demonstrate how I am attempting authenticate (This code works perfectly in local IDE but gives the error mentioned above in code editing environments within AWS):
On Cloud9 or AWS Code Editor I get:
[Error 401] access denied, invalid bearer token
On local IDE, I get 200 and the Host ID every time.
I also tested same code on personal AWS account with full admin rights. Same result.
Any ideas as to what could be restricting from within AWS environment or best way to narrow down what might be the issue?
Beta Was this translation helpful? Give feedback.
All reactions