Using Power Automate Custom Connector Oauth authorization

Hi Folks,
I’m trying to use a Power automate custom connector to authorize passing data to an API end point.

I can connect via postman using client credentials but using power automate custom connector I need to add an authorize url if using generic oAuth - the end point has a scope. I took a punt and added okta-domain/oauth2/v1/authorize however i get an error using this

my error is a 400 bad request, clients with ‘application_type’ of ‘service’ are not allowed to access the ‘authorize’ endpoint.

If I try to use Azure AD authentication I am prompted for a resource url - which Im not sure of.

Has anyone tried using a custom connector from Power automate to pass data across from M365 to the an API hosted within OKTA?

Hope this makes sense!

1 Like

Okay, looks like there is a mix of using two different OAuth flows - Authentication flows have distinct requirements and when you mix two flows it may not work.

Are you using the “oauth2generic” or something like "oauth2 " type as defined by the connector?
If yes based on what you are implementing this will change and you may need to reach out to the power automate team.
If you are doing this using a generic OAuth implementation (oauth2generic)

  • While creating this connector does this setting/form/ connector allow you to add inputs?
    For example, some custom apps allow the application type to utilize the authorization code flow, which involves providing the Client ID, Client Secret, Redirect URL, Scope, and other details and also following the application type. and other necessary parameters to make the grant work.

If this input is something you are not able to add/support then this means the connector platform does not support that flow. Eg : (You may miss adding client secret or scope or app type as the connector does not support this )

This means you may need to build out a middleware and authorize your application to access it and may not be possible from the custom connector itself…

This okta error occurs when attempting to use a different grant flow than the one supported by Okta’s setup. Unless you can change the application type to match the grant type, this will not work.

It’s a good idea to check this with the power automation docs/forums to see what is required to set this one up you may need to interact with Azure to ensure the setup is complete before working on the okta bit. You would need some sort of custom integration help from Power Automate to support this.

2 Likes