title: Azure AD B2C skip login page after authenticated with social logon
body: <p>I have set up Azure AD B2C using custom policy that supports two identity providers:</p>
  
  <ol>
  <li>Local account (email signInNames)</li>
  <li>Azure AD</li>
  </ol>
  
  <p>This means in the login page, user would be able to choose to login with Local account or click the Azure AD login button.</p>
  
  <p>Let say I have 2 portals using this B2C login, Portal A &amp; Portal B. The problem that I have right now is when a User goes to Portal A and choose Azure AD login, they will able to login fine. But when the User goes to Portal B, instead of being logged in straight away to the portal, they are presented with the B2C login page instead and have to click the Azure AD login button again. Am I missing something here? Can the user skip the login page since he has chosen Azure AD logon before (few minutes ago before the token/session timeout)?</p>
  
  <p>What I have done is configure the custom policy based on the starter pack sample. If it helps, here is the excerpt from this sign in user journey:</p>
  
  <pre><code>&lt;UserJourney Id="SignInOrSignUp"&gt;
    &lt;OrchestrationSteps&gt;   
      &lt;OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin"&gt;
        &lt;ClaimsProviderSelections&gt;
          &lt;ClaimsProviderSelection ValidationClaimsExchangeId="LocalAccountSigninEmailExchange" /&gt;
          &lt;ClaimsProviderSelection TargetClaimsExchangeId="AzureAdTenantExchange" /&gt;
        &lt;/ClaimsProviderSelections&gt;
        &lt;ClaimsExchanges&gt;
          &lt;ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" /&gt;
        &lt;/ClaimsExchanges&gt;
      &lt;/OrchestrationStep&gt;
      &lt;OrchestrationStep Order="2" Type="ClaimsExchange"&gt;
        &lt;Preconditions&gt;
          &lt;Precondition Type="ClaimsExist" ExecuteActionsIf="true"&gt;
            &lt;Value&gt;objectId&lt;/Value&gt;
            &lt;Action&gt;SkipThisOrchestrationStep&lt;/Action&gt;
          &lt;/Precondition&gt;
        &lt;/Preconditions&gt;
        &lt;ClaimsExchanges&gt;
          &lt;ClaimsExchange Id="SignUpWithLogonEmailExchange" TechnicalProfileReferenceId="LocalAccountSignUpWithLogonEmail" /&gt;
          &lt;ClaimsExchange Id="AzureAdTenantExchange" TechnicalProfileReferenceId="login-AzureAD" /&gt;
        &lt;/ClaimsExchanges&gt;
      &lt;/OrchestrationStep&gt;
       &lt;OrchestrationStep Order="3" Type="ClaimsExchange"&gt;
        &lt;Preconditions&gt;
          &lt;Precondition Type="ClaimEquals" ExecuteActionsIf="true"&gt;
            &lt;Value&gt;authenticationSource&lt;/Value&gt;
            &lt;Value&gt;localAccountAuthentication&lt;/Value&gt;
            &lt;Action&gt;SkipThisOrchestrationStep&lt;/Action&gt;
          &lt;/Precondition&gt;
        &lt;/Preconditions&gt;
        &lt;ClaimsExchanges&gt;
          &lt;ClaimsExchange Id="AADUserReadUsingAlternativeSecurityId" TechnicalProfileReferenceId="AAD-UserReadUsingAlternativeSecurityId-NoError" /&gt;
        &lt;/ClaimsExchanges&gt;
      &lt;/OrchestrationStep&gt;
      &lt;OrchestrationStep Order="4" Type="ClaimsExchange"&gt;
        &lt;Preconditions&gt;
          &lt;Precondition Type="ClaimsExist" ExecuteActionsIf="true"&gt;
            &lt;Value&gt;objectId&lt;/Value&gt;
            &lt;Action&gt;SkipThisOrchestrationStep&lt;/Action&gt;
          &lt;/Precondition&gt;
        &lt;/Preconditions&gt;
        &lt;ClaimsExchanges&gt;
          &lt;!--&lt;ClaimsExchange Id="SelfAsserted-Social" TechnicalProfileReferenceId="SelfAsserted-Social" /&gt;--&gt;
          &lt;ClaimsExchange Id="SelfAsserted-Social-NoInput" TechnicalProfileReferenceId="AAD-UserWriteUsingAlternativeSecurityId" /&gt;
        &lt;/ClaimsExchanges&gt;
      &lt;/OrchestrationStep&gt;
      &lt;OrchestrationStep Order="5" Type="ClaimsExchange"&gt;
        &lt;Preconditions&gt;
          &lt;Precondition Type="ClaimEquals" ExecuteActionsIf="true"&gt;
            &lt;Value&gt;authenticationSource&lt;/Value&gt;
            &lt;Value&gt;AzureADAuthentication&lt;/Value&gt;
            &lt;Action&gt;SkipThisOrchestrationStep&lt;/Action&gt;
          &lt;/Precondition&gt;
        &lt;/Preconditions&gt;
        &lt;ClaimsExchanges&gt;
          &lt;ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" /&gt;
        &lt;/ClaimsExchanges&gt;
      &lt;/OrchestrationStep&gt;
      &lt;OrchestrationStep Order="6" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" /&gt;    
    &lt;/OrchestrationSteps&gt;
    &lt;ClientDefinition ReferenceId="DefaultWeb" /&gt;
  &lt;/UserJourney&gt;
  </code></pre>
  
  <p>-- Update 22-July-2018 --
  Here is <code>login-AzureAD</code> technical profile with sensitive info <code>&lt;renamed&gt;</code>:</p>
  
  <pre><code>&lt;TechnicalProfile Id="login-AzureAD"&gt;
        &lt;DisplayName&gt;Azure AD Login&lt;/DisplayName&gt;
        &lt;Description&gt;Login with your &lt;renamed&gt;&lt;/Description&gt;
        &lt;Protocol Name="OpenIdConnect"/&gt;
        &lt;OutputTokenFormat&gt;JWT&lt;/OutputTokenFormat&gt;
        &lt;Metadata&gt;
          &lt;Item Key="METADATA"&gt;https://login.windows.net/&lt;renamed&gt;.onmicrosoft.com/.well-known/openid-configuration&lt;/Item&gt;
          &lt;Item Key="ProviderName"&gt;https://sts.windows.net/&lt;renamed&gt;/&lt;/Item&gt;
          &lt;Item Key="client_id"&gt;c5ca1fc8-05ad-4be4-b7b1-77de430e1099&lt;/Item&gt;
          &lt;Item Key="IdTokenAudience"&gt;c5ca1fc8-05ad-4be4-b7b1-77de430e1099&lt;/Item&gt;
          &lt;Item Key="response_types"&gt;id_token&lt;/Item&gt;
          &lt;Item Key="UsePolicyInRedirectUri"&gt;false&lt;/Item&gt;
        &lt;/Metadata&gt;
        &lt;CryptographicKeys&gt;
          &lt;Key Id="client_secret" StorageReferenceId="B2C_1A_&lt;renamed&gt;"/&gt;
        &lt;/CryptographicKeys&gt;
        &lt;OutputClaims&gt;
          &lt;OutputClaim ClaimTypeReferenceId="socialIdpUserId" PartnerClaimType="oid"/&gt;
          &lt;OutputClaim ClaimTypeReferenceId="tenantId" PartnerClaimType="tid"/&gt;
          &lt;OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" /&gt;
          &lt;OutputClaim ClaimTypeReferenceId="surName" PartnerClaimType="family_name" /&gt;
          &lt;OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" /&gt;
          &lt;OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="AzureADAuthentication" /&gt;
          &lt;OutputClaim ClaimTypeReferenceId="identityProvider" DefaultValue="&lt;renamed&gt;" /&gt;
          &lt;OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="email"/&gt;
          &lt;OutputClaim ClaimTypeReferenceId="groups" PartnerClaimType="groups"/&gt;
        &lt;/OutputClaims&gt;
        &lt;OutputClaimsTransformations&gt;
          &lt;OutputClaimsTransformation ReferenceId="CreateRandomUPNUserName"/&gt;
          &lt;OutputClaimsTransformation ReferenceId="CreateUserPrincipalName"/&gt;
          &lt;OutputClaimsTransformation ReferenceId="CreateAlternativeSecurityId"/&gt;
        &lt;/OutputClaimsTransformations&gt;
        &lt;UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop"/&gt;
      &lt;/TechnicalProfile&gt;
  </code></pre>
  
  <p>Thanks to this update request from @Chris Padgett, I noticed the error which is the session technical profile referenced <code>SM-Noop</code>. After I've changed to <code>SM-SocialLogin</code> (based on sample from others), it seems to be working now. FYI, the technical profile was created following the guide from Microsoft <a href="https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-setup-aad-custom" rel="nofollow noreferrer">here</a>.</p>
  
  <p>@Chris Padgett, is this what you're looking for? I'd appreciate some explanation on this if this were correct and accept it as answer. Might help others too.</p>