How to authenticate a user while fetching conditional access policies

Ruchi 406 Reputation points
2023-03-30T05:57:46.5133333+00:00

Am trying to fetch list of conditional access policies by hitting the api : https://graph.microsoft.com/v1.0/identity/conditionalAccess/policies

When I try from microsoft api console, am getting back desired output as I have already logged in as a user. But,  when I use the api in postman am not getting any option to enter tenant details.

Could you please help with a sample on how to fetch policies for a tenant from postman ?

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,376 Reputation points
    2023-03-31T07:41:47.37+00:00

    Hi @Ruchi

    An access token is required in postman to call that API endpoint.

    First go to Azure AD, then find your app and put https://oauth.pstmn.io/v1/browser-callback in Redirect URIs and save.

    User's image

    Next go to postman, select OAuth 2.0 in the dropdown box in Authorization, and set the property value to:

    Auth URL-> https://login.microsoftonline.com/{tenant id}/oauth2/v2.0/authorize

    Access Token URL-> https://login.microsoftonline.com/{tenant id}/oauth2/v2.0/token

    After that, this will ask you to login as administrator and agree to the Policy.Read.All permission to get an access token, then you need to click on Use Token to call the API.

    32

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


0 additional answers

Sort by: Most helpful

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.