简体   繁体   中英

Create API to authenticate users to azure active directory

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?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM