SeleniumUser
SeleniumUser

Reputation: 4177

Get OAuth2 authorize code with no user interaction but by passing username and password through parameters

I am new to azure and trying to retrieve authorization code after hitting the below API without UI interaction.

enter image description here

I don't want to interact with the Microsoft sign-in page. Is there any way to resolve this issue?

enter image description here

Upvotes: 0

Views: 2350

Answers (1)

ShwetaM
ShwetaM

Reputation: 664

Authorization code can be retrieved using OAuth 2.0 authorization code grant flow which require User Interaction .

This flow is mainly used for single page applications, web applications and native application where user interaction is required to get the access token.

The authorization code is a temporary code that the client will exchange for an access token and can be generated in the the address bar along with reply URL after user's sign in.

Refer https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow

If you looking to get access token for the service application where no user interaction is required, then client-credential flow can be used to get the access token which can be used further to call Microsoft Graph API or any customized product API.

Upvotes: 4

Related Questions