Azure-Samples / Azure-AD-B2C-page-templates

Template content for Azure AD B2C
MIT License
48 stars 52 forks source link

Azure-Samples / Azure-AD-B2C-page-templates does not render the Signinorsignup "api" properly #5

Open wikNureva opened 4 years ago

wikNureva commented 4 years ago

This issue is for a: (mark with an x)

- [ X] bug report -> please search issues before submitting
- [ ] feature request
- [X ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  1. Get these Templates
  2. Put the template files for "assets" and ocean_blue on you Blob storage
  3. Modify all so references are absolute to the locations on Blob storage
  4. Upload the modified files to Blob storage
  5. Setup a B2C tenant
  6. Adjust your blob storage to allow CORS as per Azure B2C docs
  7. Get the starter local custom policy files
  8. Modify the local custom policies and modify the TrustFrameworkBase.xml as follows for the api.signuporsignin: https:///ocean_blue/unified.html ~/common/default_page_error.html urn:com:microsoft:aad:b2c:elements:unifiedssp:1.0.0 Signin and Signup
  9. Upload your custom policy files
  10. Now try your new custom B2C_1A_signup_signin user flow

The "Email" field does not render properly

Any log messages given by the failure

Expected/desired behavior

I expect both the Email and Password fields to render identically.

If you use the EXACT same html file in a custom SignupSignIn user flow you created from the basic V1 flow the "Email" field displays just like the "Password" field (when you select the templates).

I would expect that a "Sample" that is provided would at the very least render the page correctly and as the "Email" section is inserted it is very difficult to guess what someone has changed so that the sample no longer actually works

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Windows 10

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

wikNureva commented 4 years ago

OK I believe I have found the issue. The "TrustFrameworkBase.xml" has the following claimtype: `

Sign in name string TextBox ` Changing the Id to logonIdentifier and (all the references) now allows the "api" to render properly ` Sign in name string TextBox ` It would seem that someone did a name change in the backend (the "api" code that is inserted) and this was NEVER migrated to the samples ... Here is a snippet of what was rendered to the page for the first "var SA_FIELD" BEFORE I made the change (when the email field was mangled): ... ,"DN":"Sign in name","ID":"signInName","U_HELP":"","DAY_PRE":"0" ...   This is what is rendered for the same field (which now displays the email field properly): ... ,"DN":"Sign in name","ID":"logonIdentifier","U_HELP":"","DAY_PRE":"0", ... Perhaps someone can do a review of the active-directory-b2c-custom-policy-starterpack-master xml files and update them so that they match the current Azure B2C tenants. (perhaps there are other renamed items ...) Thanks
jpda commented 4 years ago

The alternative is to update unified.css - find #logonIdentifier and add a copy of the same rule with #signInName

henriquebelotto commented 4 years ago

@wikNureva thank you very much!! I had the same issue and I have just asked in Microsoft web page. Thank you for your solution.

I tried the solution proposed by @jpda but it didn't work

MichielCornilleESC commented 4 years ago

wikNureva's solution works, especially do not forget "(all the references)". I guess a lot of people will face these issues when starting with one of the custom policy examples from the start packs. Should probably close this issue and create a new PR to update the starter packs.