user145610
user145610

Reputation: 3025

How to access token through Powershell or Postman by User ID rather than Client ID

Is there a way either in powershell or Postman to get access of myself either through login to particular tenant. I see lot of samples around getting access token either client ID or secret. But I want to run either commands or make REST call to get access token once myself get authenticated.I tried looking into graph explorer but no luck .

Upvotes: 0

Views: 1426

Answers (1)

Allen Wu
Allen Wu

Reputation: 16438

The client id is required for AAD authorization.

If you want to get an access token including your own information, you should implement OAuth 2.0 authorization code flow. It will perform interactive login as @Gaurav Mantri-AIS mentioned.

We can simply get the access token in Postman like this:

enter image description here

enter image description here

After clicking on "Request Token", it will pop up a login window. Enter your username and password. Then you will get the access token.

When we log into Graph explorer, we will see the access token here: enter image description here

In fact, Microsoft has registered an Azure AD application and provided the client id in the login request URL.

In short, we have to use the client id.

Upvotes: 1

Related Questions