I need to run a geoprocessing service as a part of the PowerAutomate Flow triggered by the S123 submission. From S123 user info, I have a valid token. The service is working and I am able to successfully run the tool using the REST form web interface, both with GET and POST requests. However, it returns the JobFailed status from Power Automate.
I also see that if I copy and paste the GET request URL from the REST form back in a web browser, my GP job get submitted again but then fails with the same error as in PowerAutomate.
URL: https://myesriportal.com/server/rest/services/My_GP_Tools/GPServer/My_Tool/submitJob?env%3AoutSR=&env%3AprocessSR=&returnZ=false&returnM=false&returnTrueCurves=false&context=&f=html&token=mytoken
Error:

After digging into it, I see that while GET request just fails, POST request gets a redirect asking for an extra login, even though I have provided the valid token in the request. If I try to reach my Portal content in the Incognito window, I am able to get to the GP service level appeding the token to the url, but as soon as I click "Submit a job", it promts the login window. So it looks like the token doesn't get through to the SubmitJob function.
As I said I need to call my GP service to be run from the PowerAutomate flow. I will appreciate all suggestions how to make it work.