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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Custom Connector Servi...
Power Automate
Suggested Answer

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

(3) ShareShare
ReportReport
Posted on by 51
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)
  • Suggested answer
    Jon Unzueta Profile Picture
    1,827 Super User 2025 Season 2 on at
     

    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.
  • CU01081209-2 Profile Picture
    51 on at
    .@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?
     
  • CU06080240-2 Profile Picture
    10 on at
    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.... 
  • DaniBash Profile Picture
    27 on at
    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 🤐

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 507 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 267 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard