I followed this article below, but I got the error below from Test the user flow section:
https://docs.microsoft.com/en-gb/azure/active-directory-b2c/configure-ropc
HTTP/1.1 400 Bad Request
Cache-Control: private
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/10.0
x-ms-gateway-requestid: fd437d7a-fd0e-42bf-adcf-0969f5dcf74d
X-Frame-Options: DENY
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Set-Cookie: x-ms-cpim-trans=; domain=mytenant.b2clogin.com; expires=Tue, 29-Jan-2019 13:35:09 GMT; path=/; secure; HttpOnly
Date: Wed, 30 Jan 2019 13:35:08 GMT
Content-Length: 217
{"error":"access_denied","error_description":"AADB2C90225: The username or password provided in the request are invalid.\r\nCorrelation ID: 9b3c19e2-6084-4bcd-b7d3-aab8d2c34dd9\r\nTimestamp: 2019-01-30 13:35:09Z\r\n"}
Request sent:
POST https://mytenant.b2clogin.com/mytenant.onmicrosoft.com/oauth2/v2.0/token?p=B2C_1_ROPC_Auth HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: mytenant.b2clogin.com
username=myemail&password=password&grant_type=password&scope=openid myappId offline_access&client_id=myappId&response_type=token+id_token
I am a global admin, but I am able to create User flow, Register application etc.
I am using Fiddler to send the request, so it is not related to WebApp/WebAPI.
The user name (e.g. [email protected]) and password are correct, which is used to login azure portal to setup the sample.
Any idea?
Update
Please note the user that I use is in User role in my firm's active directory, but the user is a global admin in the active directory associated with the newly created AD B2C tenant following https://docs.microsoft.com/en-gb/azure/active-directory-b2c/tutorial-create-tenant