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

Notifications

Announcements

Community site session details

Community site session details

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

Custom Connector with Code enabled always returns Error 403 Forbidden

(0) ShareShare
ReportReport
Posted on by 39

Hello everyone,

 

I am trying to create a custom connector and to change the request's content with the avail of the "Code" functionality. 

 

However, it does not work. I have been trying for days to send a request to one of my Web Services, which works perfectly and can be accessed without any issue outside of Power Platform. When enabling custom code, the connector will always return a 403 forbidden error no matter what.

 

In the end I decided to copy and paste the code in the Microsoft Documentation example, hoping that maybe it was something I was doing wrong, but apparently even Microsoft's own code does not work and returns that same 403 Forbidden error with an empty body. 

 

So I thought, that is not possible, my web service is well made, it works, and it is made in a way that it would return a proper error message in order to allow me to debug what is going on. So it appeared clear to me that that response was not returned by MY web service, but it is certainly coming from somewhere else. 

 

So the questions are, is there any way to understand what is going on? Why do I receive a forbidden 403 Error inside the Connector Test tab without any body whatsoever? Which resource is receiving my data and answering?

 

Thanks in advance,

have a lovely day.

Categories:
I have the same question (0)
  • Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Hi @DennisPreatto ,

     

    403 Forbidden status code means that the client credentials (access token) are valid but refuses to authorize it.

     

    Following are the possible reasons:

    • User is not authorized to access the resources
    • Access token is expired
    • Authorization server revoked access

     

    Check the API documentation or work with the owner/administrator to resolve this issue.

     

    If you like my response, please give it a Thumbs Up.
    If this helps, please Accept as solution.


    Regards
    Kaif

  • DennisPreatto Profile Picture
    39 on at

    Hello @Kaif_Siddique ,

    I am aware of the possible causes of a 403 Error, and none of those apply to my scenario. In this case, the session is authenticated by the parameters provided in the "Security" tab of the Custom Connector Setup, which is set to basic. The credentials are then provided in the connection which is created in the "Test" tab.

     

    I suppose that, even if there is custom code enabled, those credentials are used anyway to authenticate to the web server. When debugging from the web server (listening for incoming requests) there are no incoming requests, so I suppose that my web server is not the actual recipient of the data, when enabling custom code.

     

    Even using the "forwarding script" shown in the documentation:

    var response = this.Context.SendAsync(this.Context.Request, this.CancellationToken) ...

    that from my understanding is just taking the request and forwarding the request to the API endpoint without doing anything else, is not working at all and returning a 403 Error.

     

    Any other suggestion will be greatly appreciated,

     

    thanks, have a nice evening.

  • Perneel Profile Picture
    6 on at

    @Kaif_Siddique Did you ever found the cause of this issue? I'm experiencing the exact same problem at this moment. Also tried the same steps as you did, but I'm still running against a 403 error. With the Code disabled, it works.

  • stepello Profile Picture
    19 on at

    @Perneel I actually started experiencing this issue as well. Funny enough last week custom connector was working just fine. And it is not just one custom connector. I have the same one on other environments within organization and one more on the same environment. All of them stopped working and are returning 403 error. @Kaif_Siddique is it possible that something was changed this week by Microsoft that could cause the issue?

  • stepello Profile Picture
    19 on at

    I fixed the problem. In case of custom connector it was enough to go into Edit and then just Update the connector. Maybe in case of prebuilt connectors it is enough to reauthenticate them or remove and add them again. It would seem that many Azure related connectors sort of disconnected couple days ago.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard