I have a powershell script which will generate access token based on provied client ID and client Secret which will be used to invoke Search API. I run in the script in IQService Server and able to generate token but while using the same token in API header, I got 401 error.
Would appreciate if anyone can spot the issue. Attached screenshot for reference.
Not sure what some of the other variables are before your screenshot, but here is my version of /v3/search in PowerShell. It looks like the access token is good. If this doesn’t work can you try outputting the $searchIdentities object to troubleshoot if the token is in there correctly?
Hi @ethompson Thank You for your response.
I use the same part of relayed code in my already existing code still i am getting JWT required error.
Below is the screenshot for the same.
I was able to solve the issue but can’t figure out the actual issue with my code. I assume, I generated access token and reused the value in second phase and while doing the same I used “echo” command to write the output which writes value along with statement. I replaced “echo” with “Write to host” command and issue solved.