B2C Different styles for edit profile and user identity missing

Vikas Tiwari 766 Reputation points
2020-12-16T01:18:49.76+00:00

Hi @AmanpreetSingh-MSFT ,

I need few to know few details if you can please help.

1) Can we customize different styles for different profiles? i.e. Currently I have org based style for login page and same background image and styles gets applied when editing profile information. Is there any option to setup different styles for different policies?

2) I can see all user claims after login but after updating user profile information (using custom edit profile policy), User.Identity.Name is coming as null (attached is debug info). I have amusing following code in my app startup file:

 app.UseOpenIdConnectAuthentication(  
                new OpenIdConnectAuthenticationOptions  
                {  
                    // Generate the metadata address using the tenant and policy information  
                    MetadataAddress = String.Format(Globals.WellKnownMetadata, Globals.Tenant, Globals.DefaultPolicy),  

                    // These are standard OpenID Connect parameters, with values pulled from web.config  
                    ClientId = Globals.ClientId,  
                    RedirectUri = Globals.RedirectUri,  
                    PostLogoutRedirectUri = Globals.RedirectUri,  

                    // Specify the callbacks for each type of notifications  
                    Notifications = new OpenIdConnectAuthenticationNotifications  
                    {  
                        RedirectToIdentityProvider = OnRedirectToIdentityProvider,  
                        AuthorizationCodeReceived = OnAuthorizationCodeReceived,  
                        AuthenticationFailed = OnAuthenticationFailed,  
                    },  

                    // Specify the claim type that specifies the Name property.  
                    TokenValidationParameters = new TokenValidationParameters  
                    {  
                        NameClaimType = "name",  
                        //ValidateIssuer = false  
                    },  

                    // Specify the scope by appending all of the scopes requested into one string (separated by a blank space)  
                    Scope = $"openid profile offline_access {Globals.ReadTasksScope} {Globals.WriteTasksScope}"  
                }  

To fix the issue, I tried to use <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" /> inside SelfAsserted-ProfileUpdate technical profile, but then my update screen gets freeze after click on continue button.

Do you know if I am missing anything in my technical profile to populate user name?

Thanks,
Vikas Tiwari48476-b2c-debug-1.png48477-b2c-debug-2.png

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,631 questions
0 comments No comments
{count} votes

Accepted answer
  1. AmanpreetSingh-MSFT 56,301 Reputation points
    2020-12-16T12:55:57.347+00:00

    Hi @Vikas Tiwari · Thank you for reaching out.

    Yes, you can use different LoadUri value in different policy files to apply different styles. Please refer to below examples:

    ProfileEditing custom policy:

      <BuildingBlocks>  
        <ContentDefinitions>  
          <ContentDefinition Id="api.selfasserted.profileupdate">  
            <LoadUri>https://xxxxxx.blob.core.windows.net/b2c/updateprofile.html</LoadUri>  
          </ContentDefinition>  
        </ContentDefinitions>  
      </BuildingBlocks>  
    

    SignupOrSignin custom policy:

      <BuildingBlocks>  
        <ContentDefinitions>  
          <ContentDefinition Id="api.signuporsignin">  
            <LoadUri>https://xxxxxx.blob.core.windows.net/b2c/unified.html</LoadUri>  
          </ContentDefinition>  
        </ContentDefinitions>  
      </BuildingBlocks>  
    

    For the second question, do not add PartnerClaimType="name" to SelfAsserted-ProfileUpdate technical profile. Add it to the <OutputClaims> in ProfileEditing (RP) file as <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" />.

    -----------------------------------------------------------------------------------------------------------

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


0 additional answers

Sort by: Most helpful