Azure Active Directory B2C에서 사용자 지정 정책을 사용하여 암호 변경 설정

시작하기 전에 이 페이지의 맨 위에 있는 정책 유형 선택기를 사용하여 설정하려는 정책 유형을 선택합니다. Azure Active Directory B2C는 사용자가 애플리케이션과 상호 작용하는 방법을 정의하는 두 가지 방법, 즉 미리 정의된 사용자 흐름 또는 완전히 구성 가능한 사용자 지정 정책을 통해 제공합니다. 이 문서에서 필요한 단계는 각 방법마다 다릅니다.

로컬 계정으로 로그인한 사용자가 ID를 증명하기 위해 이메일 확인을 사용하지 않고 암호를 변경할 수 있도록 Azure AD B2C(Azure Active Directory B2C)를 구성할 수 있습니다.

암호 변경 흐름에는 다음 단계가 포함됩니다.

  1. 사용자가 로컬 계정에 로그인합니다. 세션이 여전히 활성 상태인 경우 Azure AD B2C는 사용자에게 권한을 부여하고 다음 단계로 건너뜁니다.

  2. 이전 암호에서 사용자는 이전 암호를 확인합니다. 새 암호에서 새 암호를 만들고 확인합니다.

    Screenshot that shows two numbered dialogs for making a password change.

사용자는 암호를 알고 있고 암호를 변경하려는 경우에만 이 문서에 설명된 암호 변경 흐름을 사용할 수 있습니다. 사용자가 암호를 잊어버린 경우를 지원하기 위해 셀프 서비스 암호 재설정을 사용하는 것이 좋습니다.

이 기능은 사용자 지정 정책에만 사용할 수 있습니다. 설정 단계의 경우 이전 선택기의 사용자 지정 정책을 선택합니다.

필수 조건

요소 추가

  1. TrustFrameworkExtensions.xml 사용자 지정 식별자가 oldPassword인 다음 ClaimType 요소를 ClaimsSchema 요소에 추가합니다.

    <BuildingBlocks>
      <ClaimsSchema>
        <ClaimType Id="oldPassword">
          <DisplayName>Old Password</DisplayName>
          <DataType>string</DataType>
          <UserHelpText>Enter your old password</UserHelpText>
          <UserInputType>Password</UserInputType>
        </ClaimType>
      </ClaimsSchema>
    </BuildingBlocks>
    
  2. ClaimsProvider 요소에는 사용자를 인증하는 기술 프로필이 포함되어 있습니다. ClaimsProviders 요소에 다음 클레임 공급자를 추가합니다.

    <ClaimsProviders>
      <ClaimsProvider>
        <DisplayName>Local Account SignIn</DisplayName>
        <TechnicalProfiles>
          <TechnicalProfile Id="login-NonInteractive-PasswordChange">
            <DisplayName>Local Account SignIn</DisplayName>
            <InputClaims>
              <InputClaim ClaimTypeReferenceId="oldPassword" PartnerClaimType="password" Required="true" />
              </InputClaims>
            <IncludeTechnicalProfile ReferenceId="login-NonInteractive" />
          </TechnicalProfile>
        </TechnicalProfiles>
      </ClaimsProvider>
      <ClaimsProvider>
        <DisplayName>Local Account Password Change</DisplayName>
        <TechnicalProfiles>
          <TechnicalProfile Id="LocalAccountWritePasswordChangeUsingObjectId">
            <DisplayName>Change password (username)</DisplayName>
            <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
            <Metadata>
              <Item Key="ContentDefinitionReferenceId">api.selfasserted</Item>
            </Metadata>
            <InputClaims>
              <InputClaim ClaimTypeReferenceId="objectId" />
            </InputClaims>
            <OutputClaims>
              <OutputClaim ClaimTypeReferenceId="oldPassword" Required="true" />
              <OutputClaim ClaimTypeReferenceId="newPassword" Required="true" />
              <OutputClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
            </OutputClaims>
            <ValidationTechnicalProfiles>
              <ValidationTechnicalProfile ReferenceId="login-NonInteractive-PasswordChange" />
              <ValidationTechnicalProfile ReferenceId="AAD-UserWritePasswordUsingObjectId" />
            </ValidationTechnicalProfiles>
          </TechnicalProfile>
        </TechnicalProfiles>
      </ClaimsProvider>
    </ClaimsProviders>
    
  3. UserJourneys 요소는 애플리케이션을 조작할 때 사용자가 사용하는 경로를 정의합니다. PasswordChange로 식별된 UserJourney에 이 요소가 없는 경우 UserJourneys 요소를 추가합니다.

    <UserJourneys>
      <UserJourney Id="PasswordChange">
        <OrchestrationSteps>
          <OrchestrationStep Order="1" Type="ClaimsProviderSelection" ContentDefinitionReferenceId="api.signuporsignin">
            <ClaimsProviderSelections>
              <ClaimsProviderSelection TargetClaimsExchangeId="LocalAccountSigninEmailExchange" />
            </ClaimsProviderSelections>
          </OrchestrationStep>
          <OrchestrationStep Order="2" Type="ClaimsExchange">
            <ClaimsExchanges>
              <ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" />
            </ClaimsExchanges>
          </OrchestrationStep>
          <OrchestrationStep Order="3" Type="ClaimsExchange">
            <ClaimsExchanges>
              <ClaimsExchange Id="NewCredentials" TechnicalProfileReferenceId="LocalAccountWritePasswordChangeUsingObjectId" />
            </ClaimsExchanges>
          </OrchestrationStep>
          <OrchestrationStep Order="4" Type="ClaimsExchange">
            <ClaimsExchanges>
              <ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
            </ClaimsExchanges>
          </OrchestrationStep>
          <OrchestrationStep Order="5" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
        </OrchestrationSteps>
        <ClientDefinition ReferenceId="DefaultWeb" />
      </UserJourney>
    </UserJourneys>
    
  4. TrustFrameworkExtensions.xml 정책 파일을 저장합니다.

  5. 시작 팩과 함께 다운로드한 ProfileEdit.xml 파일을 복사하고 이름을 ProfileEditPasswordChange.xml.

  6. 새 파일을 열고 PolicyId 특성을 고유한 값으로 업데이트합니다. 이 값은 정책의 이름입니다. 예를 들면, B2C_1A_profile_edit_password_change입니다.

  7. 만든 새 사용자 경험의 ID와 일치하도록 DefaultUserJourneyReferenceId 특성을 수정합니다. 예를 들면, PasswordChange입니다.

  8. 변경 내용을 저장합니다.

정책 업로드 및 테스트

  1. Azure Portal에 로그인합니다.
  2. 여러 테넌트에 액세스할 수 있는 경우 맨 위 메뉴에서 설정 아이콘을 선택하여 디렉터리 + 구독 메뉴에서 Azure AD B2C 테넌트로 전환합니다.
  3. Azure Portal의 왼쪽 상단 모서리에서 모든 서비스를 선택하고 Azure AD B2C를 검색하여 선택합니다.
  4. ID 경험 프레임워크를 선택합니다.
  5. 사용자 지정 정책에서 정책 업로드를 선택합니다.
  6. 정책이 있는 경우 덮어쓰기를 선택한 다음 TrustFrameworkExtensions.xml 파일을 찾아서 선택합니다.
  7. 업로드를 선택합니다.
  8. 신뢰 당사자 파일(예: ProfileEditPasswordChange.xml)에 대해 5~7단계를 반복합니다.

정책 실행

  1. 변경한 정책을 엽니다. 예를 들면, B2C_1A_profile_edit_password_change입니다.
  2. 애플리케이션에서 이전에 등록한 애플리케이션을 선택합니다. 토큰을 보려면 회신 URLhttps://jwt.ms가 표시되어야 합니다.
  3. 지금 실행을 선택합니다. 열리는 새 탭에서 URL에서 "&prompt=login"을 제거하고 탭을 새로 고칩니다. 그런 다음 이전에 만든 계정으로 로그인합니다. 암호 변경 대화 상자는 암호를 변경할 수 있는 옵션을 제공합니다.

다음 단계