question

Richard-7129 avatar image
1 Vote"
Richard-7129 asked PatrickGalbraith-9540 published

Calling API with bearer token not working

I have an API which I can call locally using a bearer token and Postman.

I can also call the API on Azure, when authentication is switched off.

However, when I switch authentication on, try to call it with a token, I receive the following error:
"The page cannot be displayed because an internal server error has occurred."

The status in Postman says "500: Unable to download OpenID Connect Configuration"

I also tried adding the authorize attribute above one route on the controller, and created another route which just returns the string "hello"; I left this route open, not requiring authentication.
Again, I can access this without authentication locally, but as soon as it's deployed to Azure, I get this same error as above.

I suspect there is something I haven't set up correctly in Azure but I can't figure it out.
I'm also not seeing anything in App Insights. Not sure if I should be able to.

Any pointers will be greatly appreciated

azure-active-directory
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Richard-7129
Thank you for your post and I apologize for the delayed response!

If you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.

0 Votes 0 ·

1 Answer

PatrickGalbraith-9540 avatar image
0 Votes"
PatrickGalbraith-9540 answered PatrickGalbraith-9540 published

I had the same issue when calling a function app. It was caused by the issuer URL being incorrect in the Authentication configuration. In my case it needed to be "<authentication-endpoint>/<tenant-id>/v2.0".

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.