azure-ad-b2c / samples

Azure AD B2C custom policy solutions and samples.
844 stars 597 forks source link

Error "Invalid username or password." #418

Open Andriy-Liulka opened 2 years ago

Andriy-Liulka commented 2 years ago

I uploaded all required files to Identity Experience Framework and after attempt to runing B2C_1A_DEMO_PASSWORDRESET_NOTLASTPASSWORD file it opens properly. But after entering email address and verification it,I tried to fill oldPassword, newPassword and reenterPassword with completely the same values and have got next error:

image After entering other password in second and third field I still got same error: image Could you please provide me some information why it could happened.

huqianghui commented 2 years ago

maybe you can refer the issue: https://github.com/azure-ad-b2c/samples/issues/407 and the issue: https://github.com/azure-ad-b2c/samples/issues/411.

  1. use microsoft edge to inspect the web console of network tab to check if there are some script error.( not chrome, use edge.)
  2. add application insight to get more log information
  3. check the configuration about endpoint and application Id and so on.
Andriy-Liulka commented 2 years ago

Thanks,I checked console issue and it is the same as in ticket #407 : [Report Only] Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'strict-dynamic' 'self' 'nonce-9is4PtajhyitYm6uYX0Tkw==' 'report-sample'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.

huqianghui commented 2 years ago

then add the below configuration can resovle the issue.

<RelyingParty>
    <DefaultUserJourney ReferenceId="SignUpOrSignInMFAOption" />
    <UserJourneyBehaviors>
      <ScriptExecution>Allow</ScriptExecution>
    </UserJourneyBehaviors>
<RelyingParty>

You can refer the document: https://docs.microsoft.com/en-us/azure/active-directory-b2c/javascript-and-page-layout?pivots=b2c-custom-policy

Andriy-Liulka commented 2 years ago

Thanks,error with JavaScript was fixed,but error with User validation still the same ( image

huqianghui commented 2 years ago

please follow the up step 2 and 3.

  1. add application insight to get more log information
  2. check the configuration about endpoint and application Id and so on.
Andriy-Liulka commented 2 years ago

@huqianghui Thanks for help, I will try to research this problem with application insight.

geekdiv commented 2 years ago

@Andriy-Liulka are you able to fix the issue ? I am facing same issue in custom change password police.

jpalo commented 2 years ago

If you have this error in user sign-in logs: The request body must contain the following parameter: 'client_assertion' or 'client_secret'.

image

Double check you have the IDs set right, I had them vice versa (client_id must be the ProxyIdentityExperienceFramework): image

SilviuMihai commented 1 year ago

@Andriy-Liulka / Besides the answer of @jpalo, please check all the steps top to bottom again, or re do it, probably you are missing a step or changed something. In my case I created the app registrations for Proxy/IdentityExperienceFramework with "Accounts in any identity provider or organizational directory (for authenticating users with user flows)". So check again to see what you missed. Good luck.

rdhaundiyalf5 commented 1 year ago

@Andriy-Liulka are you able to fix the issue ? I am facing same issue in custom change password police.

hi were you able to resolve this issue

IvanGrekov commented 1 month ago

Hi, @rdhaundiyalf5 , @Andriy-Liulka, were you able to fix this issue? Already fixed audience issue, accodingly to @SilviuMihai comment, but still get "Invalid username or password.", even though Sign In has success status in Sign In Logs