cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JanSomers91
Level 8

Custom-connector unauthorized

Basically I've started from a blank app and created a custom connector for a flow which triggers when an http-request happens.
This flow gets some query data and a file from the formData and creates a file (with metadata) in our sharepoint library. (see picture)image.png

I've fired the request multiple times in postman (application that helps you fire http requests) and everything worked as I wanted it to work. So then I decided to create a custom connector inside powerapps to allow me to fire the request with data from my app. There is not authentication and only 1 action described. Inside I set my sig, sp, sv, api-version to the values described in my flow's http request url.

image.png

 

 

Here are the contents of my open-api file (json) that I created using specgen: (some stuff is X'd out due to security reasons)

 

{
  "swagger": "2.0",
  "info": {
    "description": "Description",
    "version": "1.0.0",
    "title": "UploadExpenseNoteToSharepoint",
    "termsOfService": "https://prod-46.westus.logic.azure.com/terms-of-service",
    "contact": {
      "name": "XXXXXXXXX",
      "url": "XXXXXXXXXX",
      "email": "XXXXXXXXXXX"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "host": "prod-46.westus.logic.azure.com:443",
  "basePath": "/workflows",
  "schemes": [
    "https"
  ],
  "paths": {
    "/f7XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/triggers/manual/paths/invoke": {
      "post": {
        "summary": "Post Expense Note to Sharepoint",
        "operationId": "PostExpense",       
        "responses": {
          "202": {
            "description": "Accepted"
          }
        },
        "parameters": [
          {
            "name": "content-type",
            "in": "header",
            "description": "",
            "required": true,
            "type": "string"
          },
          {
            "name": "api-version",
            "in": "query",
            "type": "string",
            "description": "",
            "required": true
          },
          {
            "name": "sp",
            "in": "query",
            "type": "string",
            "description": "",
            "required": true
          },
          {
            "name": "sv",
            "in": "query",
            "type": "string",
            "description": "",
            "required": true
          },
          {
            "name": "sig",
            "in": "query",
            "type": "string",
            "description": "",
            "required": true
          },
		   {
            "name": "filename",
            "in": "query",
            "type": "string",
            "description": "Name of the file",
            "required": true
          },
		    {
            "name": "nature",
            "in": "query",
            "type": "string",
            "description": "Nature of the expense",
            "required": true
          },
			{
            "name": "project",
            "in": "query",
            "type": "string",
            "description": "The Project the expense is linked to",
            "required": true
          },
			{
            "name": "payment",
            "in": "query",
            "type": "string",
            "description": "The Type of payment that was used for this expense",
            "required": true
          },
			 {
            "name": "payment-specification",
            "in": "query",
            "type": "string",
            "description": "A more detailed payment type",
            "required": true
          },
		 	{
            "name": "currency",
            "in": "query",
            "type": "string",
            "description": "The currency of the cost related to the expense",
            "required": true
          },
			 {
            "name": "cost",
            "in": "query",
            "type": "string",
            "description": "",
            "required": true
          },
			  {
            "name": "file",
            "in": "formData",
            "type": "file",
            "description": "Document linked to the expense",
            "required": true
          }			 
        ]
      }
    }
  }
}

 When I test my custom connector (either in powerapps or in the custom connector test tab) i get a 401 Response.

This is the request output:

image.png

 

 

And this is the response:image.png

 

 

This is the complete body but I didn't get much out of searching solutions for it:

 

{
  "error": {
    "code": "AuthorizationFailed",
    "message": "You do not have permissions to perform action 'run' on scope '/triggers/manual/paths/'. Verify you are making the request with the appropriate HTTP method. See http://aka.ms/logic-trigger for details."
  }
}

 If you need anything else , please let me know! 
Hopefully you can assist me Smiley Very Happy

Kind regards, Jan

8 REPLIES 8
Leo09
Level 8

Re: Custom-connector unauthorized

So you cannot even add the connector to Powerapps? Or did this error happen in flow?

 

 

Highlighted
JanSomers91
Level 8

Re: Custom-connector unauthorized

it happens in the connector . I can add it to powerapps but i get the same error when performing the 'request'

jonathanO
Level: Powered On

Re: Custom-connector unauthorized

Any update here?  I am experiencing the same issue.  My logic app accepts a POST and the customer connection is configured as a POST.  I have the custom connector being called when I press a button, but PowerApps shows same error as mentioned above.

JanSomers91
Level 8

Re: Custom-connector unauthorized

It seems to be that powerapps has problems with certain open api configurations.
I got it to work after doing some adjustments , but I don't know what the problem was.

I suggest you try to get your custom connector to work using a postman collection. (v1)

JanSomers91
Level 8

Re: Custom-connector unauthorized

unintentional duplicate (can be removed)

Jim_Reynolds
Level: Power Up

Re: Custom-connector unauthorized

Hi Sam,

 

Could you explain how you got this to work as I'm hving the same problems. Thank you

JanSomers91
Level 8

Re: Custom-connector unauthorized

Use postman to form your request with all parameters possible and content body etc... based on that you can make a postman collection (v1) and create the custom connector based on that... There are guides on youtube and elsewhere on this

Jeremy78200
Level: Power Up

Re: Custom-connector unauthorized

Hello
I have the same problem
I tried with Postman but I can not post file
Thank you for your help

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 106 members 4,254 guests
Please welcome our newest community members: