Microsoft identity platform and OAuth 2.0 Resource Owner Password Credentials

Ravindra babu Mullamuri 0 Reputation points
2023-04-20T04:43:17.61+00:00
curl --location 'https://login.microsoftonline.com/tentId/oauth2/v2.0/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=xxxxxxxxx' \
--data-urlencode 'scope=User.Read profile openid email' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username=ravindra1437_outlook.com#EXT#@ravinavyamullamurioutlook.onmicrosoft.com' \
--data-urlencode 'password=xxxxxxxxxxxx' \
--data-urlencode 'client_secret=xxxxxxxxxx'

Hi I am unable to sign in and getting following issue after passing correct details please help me to resolve this issue {

"error": "invalid_grant",
"error_description": "AADSTS50126: Error validating credentials due to invalid username or password.\r\nTrace ID: bb4dd885-c0a7-4985-8d95-45c520710800\r\nCorrelation ID: 7eb0748c-6450-462d-8cd5-c48cd869d59c\r\nTimestamp: 2023-04-20 04:07:49Z",
"error_codes": [
    50126
],
"timestamp": "2023-04-20 04:07:49Z",
"trace_id": "bb4dd885-c0a7-4985-8d95-45c520710800",
"correlation_id": "7eb0748c-6450-462d-8cd5-c48cd869d59c",
"error_uri": "https://login.microsoftonline.com/error?code=50126"

}

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alfredo Revilla - Upwork Top Talent | IAM SWE SWA 27,526 Reputation points Moderator
    2023-04-30T06:29:20.27+00:00

    Hello @Ravindra babu Mullamuri , seems you're trying to login using a personal account (ravindra1437_outlook.com#EXT#@ravinavyamullamurioutlook.onmicrosoft.com). The ROPC flow does not support them. You need to login with a work or student account or switch to a multi-tenant application and a multi-tenant supporting flow such as the authorization code flow.

    Let us know if you need additional assistance. If the answer was helpful, please accept it and rate it so that others facing a similar issue can easily find a solution.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.