question

PrateekRathore-4047 avatar image
0 Votes"
PrateekRathore-4047 asked PrateekRathore-4047 commented

Adb2c custom policy with sign in button,sign up section and google button

Hi,
I want to create a custom policy with attached screenshot.. as currently Microsoft provide combined signinorsignup policy where there is a signup link then sign in fields with sign in button and then social button (like google). but, my requirements is there is sign in link then signup fields with create account button and then social button (like google).

Please let me know is there any possibility to achieve this ? @amanpreetsingh-msft @MelissaMa-msft

Thanks


![204625-image.png][1]


azure-ad-b2c
image.png (41.1 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@amanpreetsingh-msft @MelissaMa-msft Can you guys suggest something on this ?

0 Votes 0 ·

1 Answer

amanpreetsingh-msft avatar image
0 Votes"
amanpreetsingh-msft answered PrateekRathore-4047 commented

Hi @PrateekRathore-4047 • Thank you for reaching out.

For this purpose, you need to have segregated the signup and sign-in policy. Also, the content to the signup page is inserted by api.localaccountsignup, which doesn't insert the IDP buttons on the signup page itself. So, you can have a link with the signup form like Already have an account? Sign in with your local or social account that redirects you to sign-in policy that provides you with options to either sign in using a local account or social IDP like Google.

  1. First, create a unified signupOrSignin policy using Local&SocalAccounts custom policy template. You can then use the "setting.showSignupLink" item key as shown below to hide the Sign up now link so that users can use the policy only for the sign-in purpose only.

     <ContentDefinition Id="api.signuporsignin">
          <LoadUri>~/tenant/templates/AzureBlue/unified.cshtml</LoadUri>
          <RecoveryUri>~/common/default_page_error.html</RecoveryUri>
          <DataUri>urn:com:microsoft:aad:b2c:elements:unifiedssp:1.1.0</DataUri>
          <Metadata>
            <Item Key="DisplayName">Signin</Item>
            <Item Key="setting.showSignupLink">false</Item>
          </Metadata>
        </ContentDefinition>
    
  2. You can then create a SignUP user journey as mentioned below that you can point to, in your RP file e.g. B2C_1A_SignUp which can be used for sign up only.

      <UserJourney Id="SignUp">
           <OrchestrationSteps>
               
             <OrchestrationStep Order="1" Type="ClaimsExchange">
               <ClaimsExchanges>
                 <ClaimsExchange Id="SignUpWithLogonEmailExchange" TechnicalProfileReferenceId="LocalAccountSignUpWithLogonEmail" />
               </ClaimsExchanges>
             </OrchestrationStep>
            
             <!-- This step reads any user attributes that we may not have received when in the token. -->
             <OrchestrationStep Order="2" Type="ClaimsExchange">
               <ClaimsExchanges>
                 <ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
               </ClaimsExchanges>
             </OrchestrationStep>
             
             <OrchestrationStep Order="3" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
            
           </OrchestrationSteps>
           <ClientDefinition ReferenceId="DefaultWeb" />
         </UserJourney>
    

  3. Update your custom HTML page to insert Already have an account? Sign in with your local or social account link to the signup page that redirects you to the sign-in policy. Refer to page source of my html page.

  4. Update the`<LoadUri>` with the link to your custom html page under <ContentDefinition Id="api.localaccountsignup"> Click here to see the experience that you will get after you complete the above steps. Note: I have not added <Item Key="setting.showSignupLink">false</Item>` to my policy, so you'll see Don't have an account? Sign up now link on the sign-in page.


Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for the confirmation

0 Votes 0 ·