1
votes

I am trying to Create API with .net core to authenticate users to azure active directory and get the token on the response.

users will be able to hit post request to my api with their username and password and i will login on behalf of them to azure active directory.

Any suggestion how I can do that ?

1

1 Answers

2
votes

Try to request this for the response of authorization.

POST http://login.microsoftonline.com/{tenant}/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded

client_id={client_id}
&scope=user.read openid profile offline_access
&username={username}
&password={password}
&grant_type=password

For more details, see here.