Forum Discussion

spniranjan's avatar
spniranjan
Regular Visitor
5 years ago
Solved

403 Forbidden Error on fetching access token

Hi, 

 

I am trying to fetch an access token by using the following code.

But I am getting error "The remote server returned an error: (403) Forbidden". 

 

What might be the problem.

Thanks In Advance.

 

Regards

Niranjan

  • spniranjan's avatar
    spniranjan
    5 years ago

    Hi,

     

    The Issue got resolved. It was due to firewall blocking the URL.

    Once the URL was whitelisted in Firewall, I was able to fetch the access token.

     

    Thanks for the help.

     

    Regards

    Niranjan P

3 Replies

  • Hi spniranjan 

    What are you doig this in?  It's not PQ.

    Have you confrmed that the URLis valid?

    Have you tried making the request with Postman?

    have you confirmed the credentials you are using have the rights to do what you are trying?

    Phil


    If I answered your question please mark my post as the solution.
    If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.

    • spniranjan's avatar
      spniranjan
      Regular Visitor

      Hi PhilipTreacy ,

      Thanks for the reply. Sorry for the delayed response.

       

      I have created a Service Principal App in Azure webpage. I have granted permissions for the App.

      And using the App Id, App Secret and my Tenant Id I am trying to fetch the Access Token.

      But I am getting FOrbiddent 403 error.

       

      I have not tried through POstman. I tried in POstman Web but it is saying Request is not sent due to CORS.

       

      Kindly help on what may be the reason.

       

      Thanks & Regards

      Niranjan P

      • spniranjan's avatar
        spniranjan
        Regular Visitor

        Hi,

         

        The Issue got resolved. It was due to firewall blocking the URL.

        Once the URL was whitelisted in Firewall, I was able to fetch the access token.

         

        Thanks for the help.

         

        Regards

        Niranjan P