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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Custom Connector: Defi...
Power Automate
Unanswered

Custom Connector: Defining "Grant Type" for Generic OAuth 2 security

(0) ShareShare
ReportReport
Posted on by 4

I'm using a Postman v1 file to setup a Custom Connector. My API uses OAuth 2.0 with a username, password, client id, and secret...and requires the "grant type" parameter in the authentication request URL to be set to "password". The specific error message provided by my web server is:

{"error_description":"Missing grant_type parameter value","error":"invalid_request"}

How can I set the grant type to password and define a username & password in Flow for a Custom Connector? This is used by the API as a bearer token has to be included in the authorization header of all API calls.

Categories:
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi jimmyg,

     

    Have you seen this doc about how to register custom connectors in Microsoft Flow? Please follow the steps in this doc to create the connector:
    https://docs.microsoft.com/en-us/flow/register-custom-api

     

    Please check your Swagger file and make sure you have specified all the required parameters.


    Best regards,
    Mabel Mao

  • jimmyg Profile Picture
    4 on at

    Hi Mabel,

     

    I'm using a Postman v1 file, not Swagger. I'm not sure of any way to define this info in the Postman file, but it does work correctly in the Postman app.

     

    Based on what you wrote, I created a Swagger v2 file with the following security parameters:

     

     "host": "app1pub.smappee.net",
     "basePath": "/dev/v1",
     "securityDefinitions": {
     "auth": {
     "type": "oauth2",
     "flow": "password",
     "tokenUrl": "https://app1pub.smappee.net/dev/v1/oauth2/token",
     "refreshUrl": "https://app1pub.smappee.net/dev/v1/oauth2/token",
     "scopes": {},
     "x-skip-client-authentication": false
     }

     

    When I try to create a custom connector in Flow using this file, I get the following error:

     

    The request failed with error: '{"Code":"ValidationError","Message":"One or more fields contain incorrect values:","Target":null,"Details":[{"Message":"One or more fields contain incorrect values:"},{"Code":"ValidationError"},{"ErrorEntity":{"ExtendedCode":"Entity field: apiDefinitionUrl","InnerErrors":[{"Parameters":["contract","apiDefinitionUrl"],"Code":"ValidationError","Message":"Parsing error(s): JSON is valid against more than one schema from 'oneOf'. No valid schemas. Path 'securityDefinitions.auth', line 4789, position 13."}],"Code":"ValidationError","Message":"One or more fields contain incorrect values:"}}],"Innererror":null}'. The tracking Id is '7dd5cf3e-7b8d-4074-a1d5-2bf76e61d7eb'.

    Any suggestions for what is going wrong?

     

    Thanks,

    -Jimmy.

  • awildash Profile Picture
    6 on at

    Did you get anywhere with this? I'm having a similar problem where I want to use OAuth2 Client Credentials. Flow has the "Generic Oauth 2" auth type but Oauth2 isnt generic, different flavours require different params.

     

    It looks like "Generic OAuth 2" only supports Authroization Code Grant, but I cant find this explicity stated anywhere in the docs.

  • sfratice Profile Picture
    3 on at

    I'm also facing the same - anyone found a way to change the grant type?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 423

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 177

Last 30 days Overall leaderboard