MSAL Azure Protected Web API giving error "Sign in to your account" in Postman and programtically in Android

sumit soni 1 Reputation point
2022-05-30T11:53:57.777+00:00

Hi ,

I am trying to access an azure protected web api which is working fine in browser but not working in Android app and in postman.
When I try to hit the Web API in browser, Microsoft authentication pops up and after success authentication, the response of the API gets pop up in the browser.
When I try to access the url in postman, I am getting "Sign into your account" html response .

I tried using Bearer Authentication token in postman but still getting html login response.

Any help appreciated.

Thanks
Sumit Soni

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 30,296 Reputation points Microsoft Employee Moderator
    2022-05-31T08:48:43.393+00:00

    Hi @sumit soni ,

    Thanks for reaching out.

    I understand you are trying to access protected web API using postman and Android application and getting below error

    206939-image.png

    I am able to replicate your scenario and the reason its asking to "Sign into your account" when you are trying to call API using client application URL. When you are trying calling API using client application's URL, application is looking for user interaction and asking to "Sign into your account" through browser.

    In the postman, we are testing API without calling client application by providing access token authenticated using your client application details as shown below, then you need to provide URL specific of protected API rather than URL of client application.

    206898-image.png

    Hope this will help.

    Thanks,
    Shweta

    --------------------------------------------------

    Please remember to "Accept Answer" if answer helped you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.