2017-12-12 13 views
1

사용자 정의 B2C 정책을 만들고 있는데 사용자 이름으로 생성 된 로컬 계정에 대한 비밀번호 재설정 여행을 복제하려고합니다.사용자 이름으로 B2C/IEF 비밀번호 재설정

나는 AD에서 사용자 이름을 읽을 수 있지만 확인 된 이메일 주소를 계정에 대해 확인하는 방법을 잘 모르겠습니다.

현재 사용자 이름이 올바른 경우 모든 이메일 주소를 사용하여 확인할 수 있습니다.

기술 프로필 :

<TechnicalProfile Id="SA-LocalAccountDiscoveryUsingLogonName"> 
     <DisplayName>Reset password using logon name</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.localaccountpasswordreset</Item> 
     </Metadata> 
     <IncludeInSso>false</IncludeInSso> 
     <OutputClaims> 
     <OutputClaim ClaimTypeReferenceId="signInName" Required="true" /> 
     <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="Verified.Email" Required="true" /> 
     <OutputClaim ClaimTypeReferenceId="objectId" /> 
     <OutputClaim ClaimTypeReferenceId="userPrincipalName" /> 
     </OutputClaims> 
     <ValidationTechnicalProfiles> 
     <ValidationTechnicalProfile ReferenceId="AAD-UserReadUsingLogonName" /> 
     </ValidationTechnicalProfiles> 
    </TechnicalProfile> 

검증 기술 정보 :

<TechnicalProfile Id="AAD-UserReadUsingLogonName"> 
     <Metadata> 
     <Item Key="Operation">Read</Item> 
     <Item Key="RaiseErrorIfClaimsPrincipalAlreadyExists">true</Item> 
     </Metadata> 
     <InputClaims> 
     <InputClaim ClaimTypeReferenceId="signInName" PartnerClaimType="signInNames.userName" Required="true" /> 
     </InputClaims> 
     <OutputClaims> 
     <OutputClaim ClaimTypeReferenceId="objectId" /> 
     <OutputClaim ClaimTypeReferenceId="userPrincipalName" /> 
     </OutputClaims> 
     <IncludeTechnicalProfile ReferenceId="AAD-Common" /> 
     <UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" /> 
    </TechnicalProfile> 

사용자의 여행 :

<UserJourney Id="PasswordReset"> 
    <OrchestrationSteps> 
    <!--Get user by username--> 
    <OrchestrationStep Order="1" Type="ClaimsExchange"> 
     <ClaimsExchanges> 
     <ClaimsExchange Id="PasswordResetUsingEmailAddressExchange" TechnicalProfileReferenceId="SA-LocalAccountDiscoveryUsingLogonName" /> 
     </ClaimsExchanges> 
    </OrchestrationStep> 

    <!--Reset password--> 
    <OrchestrationStep Order="2" Type="ClaimsExchange"> 
     <ClaimsExchanges> 
     <ClaimsExchange Id="NewCredentials" TechnicalProfileReferenceId="SA-LocalAccountPasswordReset" /> 
     </ClaimsExchanges> 
    </OrchestrationStep> 

    <!--Read remaining attributes of user--> 
    <OrchestrationStep Order="3" Type="ClaimsExchange"> 
     <ClaimsExchanges> 
     <ClaimsExchange Id="ReadUser" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" /> 
     </ClaimsExchanges> 
    </OrchestrationStep> 

    <!--Create token--> 
    <OrchestrationStep Order="4" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" /> 
    </OrchestrationSteps> 
    <ClientDefinition ReferenceId="DefaultWeb" /> 
</UserJourney> 
+0

안녕하십니까? 최종 사용자에게 사용자 이름과 전자 메일 주소를 입력하고 확인 코드를 보내어이 전자 메일 주소의 유효성을 검사 한 다음 전자 메일 주소와 연결되어 있는지 확인하도록 요청하고 싶습니다. 사용자 이름? –

+0

네, 그렇게하고 싶습니다. – nyoung

+0

이메일 주소를 Azure AD Graph API에서 쿼리 할 수있는 사용자 속성에 저장 하시겠습니까? –

답변

2

는 "otherMails"모두에 이메일 주소를 작성하는 경우와 "strongAuthenticationEmailAddress "속성을 사용하면 전자 메일 주소가 assoc인지 확인할 수 있습니다 REST API를 사용하여 비밀번호 재설정 정책을 수행하는 동안 사용자 이름과 일치합니다.

이 REST API는 클레임 ​​공급자로 선언해야합니다 :

<ClaimsProvider> 
    <DisplayName>REST APIs</DisplayName> 
    <TechnicalProfiles> 
     <TechnicalProfile Id="RestApi-CheckUser"> 
      <DisplayName>Check User REST API</DisplayName> 
      <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.RestfulProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> 
      <Metadata> 
       <Item Key="ServiceUrl">Insert the REST API endpoint URL</Item> 
       <Item Key="AuthenticationType">None</Item> 
       <Item Key="SendClaimsIn">Body</Item> 
      </Metadata> 
      <InputClaims> 
       <InputClaim ClaimTypeReferenceId="signInName" /> 
       <InputClaim ClaimTypeReferenceId="email" /> 
      </InputClaims> 
      <UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" /> 
     </TechnicalProfile> 
    </TechnicalProfiles> 
</ClaimsProvider> 

은 "signInNames"와 "otherMails"(하늘빛 AD 그래프 API를 수행 할 수 있습니다 사용 특성 '에 의해 사용자 개체를 조회 할 수있는 REST API를 이 그래프 API를 사용하여 "strongAuthenticationEmailAddress"속성을 읽고 the REST API walkthrough에 설명 된대로 이메일 주소가 사용자 이름과 연결되어 있으면 200 OK을, 그렇지 않은 경우 409 Conflict을 반환합니다.

REST API 기술 프로파일은 다음 "SA-LocalAccountDiscoveryUsingLogonName"기술 프로필에서 검증 기술 프로파일로 호출 할 수 있습니다

: "다음

<TechnicalProfile Id="SA-LocalAccountDiscoveryUsingLogonName"> 
    <ValidationTechnicalProfiles> 
     <ValidationTechnicalProfile ReferenceId="RestApi-CheckUser" /> 
     <ValidationTechnicalProfile ReferenceId="AAD-UserReadUsingLogonName" /> 
    </ValidationTechnicalProfiles> 
</TechnicalProfile> 

은"RestApi-CheckUser "기술 프로필 200 OK을 반환하는 경우, AAD-UserReadUsingLogonName "기술 프로필이 호출되고 최종 사용자는 암호 재설정을 계속할 수 있습니다. "RestApi-CheckUser"기술 프로필이 409 Conflict을 반환하면 "AAD-UserReadUsingLogonName"기술 프로필이 호출되지 않고 최종 사용자가 계속 진행할 수 없습니다.