Hello.
I’m trying to add an item to a queue using Microsoft Forms and Power Automate.
The issues starts when the flow is actually trying to send the response to the queue in Orchestrator.
Basically, I have tried 2 types of approach for authentication, and both of them retrive the access token successfully, which I need for the last API call to Orchestrator.
But when it executes the last HTTP Request, it says the following:
{ "message": "You are not authenticated!", "errorCode": 0, "result": null, "targetUrl": null, "success": false, "error": { "code": 0, "message": "You are not authenticated!", "details": "You should be authenticated (sign in) in order to perform this operation.", "validationErrors": null }, "unAuthorizedRequest": true, "__abp": true }
Flows are using the following for the authentication:
First flow:
-
URI
https://account.uipath.com/oauth/token
-
Headers:
- Content-Type : application/json
- X-UiPath-TenantName : DefaultTenant
-
Body:
{ "grant_type": "refresh_token", "client_id": "qwerty1234", "refresh_token": "abcdef9876" }
Second flow:
-
URI
https://cloud.uipath.com/identity_/connect/token
-
Headers:
- Content-Type: application/x-www-form-urlencoded
-
Body:
grant_type=client_credentials&client_id=qwerty1234&client_secret=abcdef9876&scope=OR.Queues%20OR.Queues.Write
The both variants work just fine, and in the Output I can see the Bearer (access token), as it follows:
{
"access_token": "eyJhbGciOi....",
"id_token": "eyJhbGciO...",
"scope": "openid profile email offline_access",
"expires_in": 86400,
"token_type": "Bearer"
}
However, the error occurs at the last HTTP Request, as you can see in the snip below.:
Now, its worth mentioning that I have also set the External Application for Power Automate, using the application scopes ‘OR.Queues OR.Queues.Write’.
Do you have any advice/idea why this is happening? I was trying to figure it out for the last 3 days but I still don’t get it.
Any response will be appreciated! Thanks a lot!