Good but the point is how is this error thrown? Is that a 401?
Or is any kind of error regarding the policy and therefore I would have to know this error?
When I use the trace to debug the access token renewal I get no error message except for a 401 in the end which does not tell me if it was caused by the policy or sent by the backend itself, did ou get it?
The documentation and examples should have this shown.
Anyway, I'm using client credentials, so I won't have a refresh token URL.
OK for that. I get that I have to keep an eye on the error message. But if I don't know what kind of message is that, I cannot handle it.
So far I'm just having this:
get-authorization-context (6.499 ms)
"Using cache 'internal'."
get-authorization-context (595.598 ms)
{
"message": "Obtaining managed identity token using clientId:f0da2222-67f1-4229-2202-eb2221369287 AAD Authority:https://login.windows.net/82222226-0477-4390-b86e-22222222222 for https://apihub.azure.com audience succeeded.",
"errorResponse": null
}
get-authorization-context (621.931 ms)
{
"message": "Obtaining managed identity token using clientId:f011113e-67f1-4b79-8d02-11111369287 AAD Authority:https://login.windows.net/82222226-0477-4390-b86e-22222222222 for https://azure-api.net/authorization-manager audience succeeded.",
"errorResponse": null
}
get-authorization-context (5.845 ms)
{
"message": "Sending request to authorization provider gateway.",
"request": {
"apimServiceName": "3333y",
"providerId": "outsystems-oauth2",
"authorizationId": "outsystems-oauth2",
"identityType": "managed",
"identityMetadata": "{ objectId: 441d34344500494, tenantId: 809f94a63434344353453a7 }",
"correlationId": "9ad2432345d2"
}
}
get-authorization-context (2,255.140 ms)
"Using cache 'internal'."
get-authorization-context (9.969 ms)
"Authorization context was added to 'auth-context' variable."
set-header (5.827 ms)
{
"message": "Expression was successfully evaluated.",
"expression": "((Authorization)context.Variables.GetValueOrDefault(\"auth-context\"))?.AccessToken",
"value": "eyJhbGciOiJIUzI1NiIs-.-Njc1MTg5Mz-TR9.-P9Vw"
}
set-header (0.014 ms)
{
"message": "Specified value was assigned to the header (see below).",
"header": {
"name": "Authorization",
"value": "eyJhbGciOiJIUzI1NiIs-.-Njc1MTg5Mz-TR9.-P9Vw"
}
}
Which means I'm still getting a token, invalid though......