Request-FalconToken #169
-
Am completely new to PSFalcon, just newly installed PSFalcon for a specific requirement. I have generated an API token on the Falcon UI and I am trying to request the falcon token, it results in this error: (Customer ID is redacted) Write-Result : [{"code":403,"message":"Failed to generate access token for customer ID=xxxxxxxxxxxxxxxxxxxxxxxxxx"}]
Am dropping an image of the Oath2.ps1, you could look at the line/chars referenced here. Am short of ideas as to what is wrong with this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Most often, this error occurs when your token request is rejected due to attempting the request with the wrong cloud. Although the APIs are designed to redirect you to the right place, this doesn't work if your CID exists in Because
https://github.com/CrowdStrike/psfalcon/wiki/Authentication#alternate-clouds |
Beta Was this translation helpful? Give feedback.
-
This is already done. Could be closed. |
Beta Was this translation helpful? Give feedback.
Most often, this error occurs when your token request is rejected due to attempting the request with the wrong cloud. Although the APIs are designed to redirect you to the right place, this doesn't work if your CID exists in
us-gov-1
, and sometimes fails due to PowerShell 5.1 handling the errors slightly differently than PowerShell Core (v7+).Because
Request-FalconToken
defaults to the US-1 cloud (https://api.crowdstrike.com
), you can resolve this by specifying the-Cloud
or-Hostname
parameter when runningRequest-FalconToken
.https://github.com/CrowdStrike/psfalcon/wiki/Authentication#alter…