web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Connector Development
Suggested answer

Custom Connector Service Principal Connection API registration error: Parameter not allowed.

(3) ShareShare
ReportReport
Posted on by 16
Hey all,

I've been trying to set up a custom trigger using polling, and using a service principal-connection. I'm able to set up a normal OAuth user-connection, but unfortunately the service principal connection doesn't work. 
When I'm using normal OAuth user-connection, I'm able to execute my HTTP requests and get the data I wanted, suggesting that the issue is only with the authentication.
 
I'm getting 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.."

It appears I somehow need to add parameters to my swagger code, such as the clientId parameter. 

I have tried to add the parameter to the root of my Swagger file, but this doesn't change the behavior. ChatGPT suggested to add x-ms-connection-parameters to my file as follows:
 
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

However, this did not fix the issue and I also couldn't find any other sources suggesting this. 

Is there something I'm clearly doing wrong here? How would I go about fixing this issue? Any help would be greatly appreciated.


Edit: 
I am able to execute this HTTP request in Postman, with grant_type client credentials.  The authorization parameter values seem to be fine, there is only a problem with how the API is registered through Swagger / Power Automate.
 
 
Categories:
I have the same question (0)
  • DaniBash Profile Picture
    12 on at
    Custom Connector Service Principal Connection API registration error: Parameter not allowed.
    I've also been having this issue for two weeks and still havent found a solution. There are a few other posts about this.
    he workaround suggested in other search results, which consists of creating the connection from Power Automate doesn't work for me.
     
    BTW: Jon Uzueta IA answer also suggest giving the client secret in the code 🤐
  • CU06080240-2 Profile Picture
    2 on at
    Custom Connector Service Principal Connection API registration error: Parameter not allowed.
    I'm experiencing the same problem on creation of connection both at Power Apps and Power Automate.
    Since I sufferred from the issue at Power Apps Studio in this July, I could create a new connection of the same custom connector at Power Automate as a workaround. Power Automate did not show the symptom described in the post. But from August 5th, the workaround does not work, it started showing the same symptom.. I have no idea to resolve it.... 
  • CU01081209-2 Profile Picture
    16 on at
    Custom Connector Service Principal Connection API registration error: Parameter not allowed.
    .@Jon Unzueta Thank you for your reply. Unfortunately, the issue still persists, so if you or anyone else has any ideas / experience with this, please let me know.

    Unfortunately, the issue still persists. I'm getting the same 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..".
     
    I'm wondering if this is the correct way to go abouth this, because when I fill in my security parameters through the 'security' tab in the Power Automate interface, it doesn't automatically add the x-ms-connection-parameters and x-ms-connector-authentication parameters to the swagger file. When I choose Azure Active Directory as the ID-provider for OAuth 2.0, there is an option to enable service-principal support. I would expect this functionality to work without any problems. Is it common that this kind of service principal authentication does not work without additional manual changes to the swagger file?
     
  • Suggested answer
    Jon Unzueta Profile Picture
    1,215 Super User 2025 Season 2 on at
    Custom Connector Service Principal Connection API registration error: Parameter not allowed.
     

    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.


    🔍 Root Cause

    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 .

     


    ✅ Recommended Fixes

    1. Use 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 .

     

    2. Avoid Using token: Prefix

    The 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.

    3. Use Azure Managed Identity or OAuth 2.0 with Client Credentials

    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  .

    🏷️ Tag me if you have any further questions or if the issue persists.
    ✅ Click "Accept as Solution" if my post helped resolve your issue—it helps others facing similar problems.
    ❤️ Give it a Like if you found the approach useful in any way.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Featured topics