Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
spniranjan
Regular Visitor

403 Forbidden Error on fetching access token

Hi, 

 

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

spniranjan_1-1604060179135.png

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

 

What might be the problem.

Thanks In Advance.

 

Regards

Niranjan

1 ACCEPTED SOLUTION

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

View solution in original post

3 REPLIES 3
PhilipTreacy
Super User
Super User

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.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


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

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.