Azure B2C AD: Is the email address mandatory for Local Accounts identity providers based on Username?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Azure B2C AD: Is the email address mandatory for Local Accounts identity providers based on Username?



Am I missing something? It does not seem to be possible to set it up so that the email address is not required (or not even prompted for at all) during sign-up? You can only disable the email verification.



We may not allow the users to enter an email address at all. They must register with a username only. Surely this must be supported?



I have redone the entire process over from scratch twice now following all the documentation I could find on the topic. But the outcome remains the same. I start by creating a new B2C tenant and I ensure that under Identity Providers, only "Username" is selected as the "Local Accounts". Then I go to "Sign-up or sign-in policies" and create a custom template, then click on edit. Then I ensure that the Identity Providers is set to only the "User ID signup" (and Local Account), and that in the Sign-up Attributes as well as in the Application Claims I do not have the "Email Address" selected. Then I go to "Page UI Customization" and click on "Local account sign-up page". I enter my custom URL. Under the "Sign-up attributes" it lists "Email Address". Email address should not be there AT ALL. When I click on Email Address there is only an option to set "Require verification" to No. The Optional toggle switch is DISABLED. So I can't even make it optional.



The main point here is that when I use "Username" instead of "Email" as the Identity Provider, it should most definitely not force an email address on me.



If you try the above steps in the Azure Portal as it stands today 8 Aug 2018 I am sure you will find the same restriction. This seems like a bug to me, maybe it slipped in somewhere along the line?





Hi. You need an email address for password reset, for example. If you take a look at the user journey steps and technical profiles, you will see the email is required.
– Marcelo P. Di Iorio - MSFT
Aug 9 at 8:29





And of course, this may change in the future. I suggest you take a look at the uservoice portal for AAD B2C.feedback.azure.com/forums/169401-azure-active-directory/…
– Marcelo P. Di Iorio - MSFT
Aug 9 at 8:31





@MarceloP.DiIorio-MSFT I have already added the idea on the uservoice site: feedback.azure.com/forums/169401-azure-active-directory/…
– user2935274
Aug 10 at 8:23




2 Answers
2



Yes it is possible to register the user in B2C without email using custom policies.
You can follow the steps mention here to create custom policies and download the starter kit which has examples of how the policies can be modified to suit your requirement.



Below is the TechnicalProfile which i have used to SignUp user without email being mandatory


<TechnicalProfile Id="LocalAccountSignUpWithLogonName">
<DisplayName>User ID signup</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="IpAddressClaimReferenceId">IpAddress</Item>
<Item Key="ContentDefinitionReferenceId">api.localaccountsignup</Item>
<Item Key="LocalAccountType">Username</Item>
<Item Key="LocalAccountProfile">true</Item>
<Item Key="language.button_continue">Create</Item>
</Metadata>
<CryptographicKeys>
<Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
</CryptographicKeys>
<InputClaims>
<InputClaim ClaimTypeReferenceId="signInName" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="objectId" Required="true" />
<OutputClaim ClaimTypeReferenceId="signInName" Required="true" />
<OutputClaim ClaimTypeReferenceId="email" />
<OutputClaim ClaimTypeReferenceId="newPassword" Required="true" />
<OutputClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
<OutputClaim ClaimTypeReferenceId="jobTitle" />
<OutputClaim ClaimTypeReferenceId="postalCode" />
<OutputClaim ClaimTypeReferenceId="city" />
<OutputClaim ClaimTypeReferenceId="givenName" />
<OutputClaim ClaimTypeReferenceId="surName" />
<OutputClaim ClaimTypeReferenceId="executed-SelfAsserted-Input" DefaultValue="true" />
<OutputClaim ClaimTypeReferenceId="newUser" />
<OutputClaim ClaimTypeReferenceId="authenticationSource" />
<OutputClaim ClaimTypeReferenceId="userPrincipalName" />
</OutputClaims>
<ValidationTechnicalProfiles>
<ValidationTechnicalProfile ReferenceId="AAD-UserWriteUsingLogonName" />
</ValidationTechnicalProfiles>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
</TechnicalProfile>





For reset password you can collect phone number during registration, in password reset policy you can use <OutputClaim ClaimTypeReferenceId="OfficePhone" PartnerClaimType="Verified.OfficePhone" /> under LocalAccountDiscoveryUsingLogonName technical profile followed by comparing it with <InputClaim ClaimTypeReferenceId="OfficePhone" PartnerClaimType="TelephoneNumber " Required="true" /> in AAD-UserReadUsingLogonName technical profile. For more information see page
– Jagadish KM
Aug 10 at 13:03


<OutputClaim ClaimTypeReferenceId="OfficePhone" PartnerClaimType="Verified.OfficePhone" />


<InputClaim ClaimTypeReferenceId="OfficePhone" PartnerClaimType="TelephoneNumber " Required="true" />





Mark it as answer if it solved your problem.
– Jagadish KM
Aug 21 at 18:08



The toggle switch that allows you to select between username-based or email-based account is to indicate which of these will be used for sign-in. However, this does not mean that in a username-based account, the email will not be collected - it's just that email cannot be used to sign-in.



Regardless, the email address in basic policies is required to support password reset user journeys even for username-based accounts. If B2C does not collect the email address, then a user cannot reset their password even if they forgot it.



If you really want to not collect email, then your only option today is to use custom policies. In that case, you will have to determine how you want to support password reset, if at all.





What about using the mobile number for password resets instead of the email address?
– user2935274
Aug 10 at 8:04





Support for mobile numbers does not exist today. It could be added in the future though.
– Omer Iqbal
Aug 30 at 0:09






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard