Reputation: 319
I have a .net core API and JWT token authentication code is added in the application. My problem is how can I generate the bearer token from any application so that I can authenticate the request. I am not able to generate the bearer token.
I have tried lots of options like from Postman GetNewAccessToken. Its asks for Single sign-on but after sign-in open the Microsoft office website in a new window. How can I get bearer token from Postman?
Is there is any way for getting the bearer token from C# application using users's credentials or using single sign on?
I need a bearer token just to authenticate my request.
Upvotes: 0
Views: 3160
Reputation: 2486
If you want to retrieve the token programmatically, you should check out Microsoft Authentication Library (MSAL): https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-overview and more specifically MSAL.NET
Upvotes: 1
Reputation: 15551
Open up your F12 developer tools in your browser, look up an authenticated request and have a look at the Authentication header. It has a current version of a Bearer token.
For instance:
/me
in the Network tabUpvotes: 1