Skip to content

Error InvalidAuthenticationAudience when calling a Custom API from a Canvas App #2986

Description

@BugsOli

Hello, we are getting this error when calling a Custom API in our dev environment:

"response": {
          "error": {
            "code": "InvalidAuthenticationAudience",
            "message": "The received access token has been obtained from wrong audience or resource 'https://xxx.crm4.dynamics.com/'. It should exactly match (including forward slash) with one of the allowed audiences 'https://service.powerapps.com/','https://apps.powerapps.com','https://apps.powerapps.com/','https://apihub.azure.com','https://api.powerplatform.com'."
          }
        }
"_serviceType": "connector",
      "_suggestedErrorMessage": {
        "message": "One or more of your connections may not be authenticated. Please restart the app to fix this."
      },
      "_diagnosticMessage": "The received access token has been obtained from wrong audience or resource 'https://xxx.crm4.dynamics.com/'. It should exactly match (including forward slash) with one of the allowed audiences 'https://service.powerapps.com/','https://apps.powerapps.com','https://apps.powerapps.com/','https://apihub.azure.com','https://api.powerplatform.com'."
    }

The Power FX code is:

Environment.book_api(
            {
                qId: Quote.Quote,
                qoId: Option.'Quote Product',
                bill: varBill
            }
        );

Our environment is in North Europe, which should not have an impact.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions