I am trying to create a custom connector to an existing API which uses oauth2 with the application flow type.
In the security tab there is no option to change the flow type.
In the swagger editor I can change the flow type and remove the authorization url:
securityDefinitions:
oauth2_auth:
type: oauth2
flow: application
tokenUrl: https://.../connect/token
scopes: {...: ...}
After these changes I can succesfully authorize with the api using the authorize button.
The problem is that these changes are not saved; when I switch away from the swagger editor my changes are reverted.
I've also tried using the update connector button from the swagger editor, but also no luck.
One other thing I have tried is creating a collection in postman describing the api with the correct authentication settings, but these settings are not used by the create a custom connector wizard.
Hi @NicoD
You will need to use the `Update Connector` button to save changes. I would recommend you to use the CLI tool we have written. This give you a bit more power to control the development. Look at this documentation here: https://docs.microsoft.com/en-us/connectors/custom-connectors/paconn-cli
By using the CLI you can save the Swagger changes locally and manage using a source control. You can then directly publish these changes to flow.
If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION ☑️. If you find this reply helpful, please consider giving it a LIKE 👍.
Hi murshed,
Thank you for your reply. At least it helped me look into the right direction.
1) Whenever I press update the underlying specification seems to change in some strange way: the oauth settings seems to be forced to use accessCode flow instead of application flow.
2) When I create or update the connector using the paconn cli tools I get a json validation error:
"code": "SwaggerParsingError",
"message": "JSON is valid against no schemas from 'oneOf'. Path 'securityDefinitions.oauth2_auth'."
3) Some other strange thing that happens is that the security definition
"securityDefinitions": {
"oauth2": {
Often gets changed to
oauth2_auth
While searching on this error message I stumbled upon:
And I also found:
https://github.com/microsoft/PowerPlatformConnectors/issues/225
So I'm afraid it’s not going to work. The first link seems to contain a workaround. Hopefully I can get it to work with that.
Check out new user group experience and if you are a leader please create your group
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
3 | |
3 | |
3 | |
2 | |
2 |