x-ms-connection-parameters:
clientId:
type: string
uiDefinition:
displayName: Client ID
description: Client ID van de service principal
tooltip: Geef de Client ID op die gebruikt wordt voor authenticatie
constraints:
required: true
clientSecret:
type: string
uiDefinition:
displayName: Client Secret
description: Client Secret van de service principal
tooltip: Geef de Client Secret op die gebruikt wordt voor authenticatie
constraints:
required: true
uiControl: password
tenantId:
type: string
uiDefinition:
displayName: Tenant ID
description: Tenant ID (directory ID) van Azure AD
tooltip: Geef de Tenant ID op die gebruikt wordt voor authenticatie
constraints:
required: true
You're encountering the error:
"Custom Connector Service Principal Connection API registration error: Parameter 'token:clientId' is not allowed on the connection since it was not defined as a connection parameter when the API was registered."
This happens when trying to authenticate a custom connector in Power Automate using a service principal instead of a user-based OAuth connection. You've correctly identified that the issue lies in how the Swagger/OpenAPI definition is registered and how connection parameters are declared.
The error indicates that Power Automate is rejecting the token:clientId
parameter because it wasn't declared as a connection parameter during the connector registration. Even though you added x-ms-connection-parameters
to your Swagger file, Power Automate still doesn't recognize it—suggesting that the connector registration process didn’t properly bind those parameters to the authentication scheme .
x-ms-connection-parameters
with x-ms-connector-authentication
You need to define both the connection parameters and the authentication scheme in your Swagger file. Here's a working pattern:
x-ms-connector-authentication:
type: "oauth2"
identityProvider: "aad"
clientId: "your-client-id"
clientSecret: "your-client-secret"
tenantId: "your-tenant-id"
scope: "https://graph.microsoft.com/.default"
parameters:
- name: "clientId"
type: "string"
- name: "clientSecret"
type: "securestring"
- name: "tenantId"
type: "string"
Make sure these parameters are also declared under x-ms-connection-parameters
with proper UI definitions .
token:
PrefixThe prefix token:
is reserved for internal use and should not be manually added. Instead, define your parameters as clientId
, clientSecret
, and tenantId
without the token:
prefix.
If you're using a service principal, ensure your connector uses OAuth 2.0 with client credentials flow. Power Automate currently has limited support for service principal authentication in custom connectors .
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2