cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NicoD
Frequent Visitor

Custom connector - changes to swagger editor security settings not saved

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.

 

2 REPLIES 2
murshed
Microsoft
Microsoft

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

NicoD
Frequent Visitor

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:

https://powerusers.microsoft.com/t5/Connecting-To-Data/Are-other-flow-than-accessCode-supported-by-O...

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.

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (71,359)