2017-12-12 15 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> 

REST APIは(あなたは「缶「signInNames」とAzureのADグラフAPIを使用して「otherMails」プロパティにより、ユーザーオブジェクトを照会することができますこのグラフ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-チェックユーザー」技術的プロファイルは200 OKを返した場合、 AAD-UserReadUsingLogonName "テクニカルプロファイルが呼び出され、エンドユーザはパスワードリセットを続行できます。 「RestApi-CheckUser」技術プロファイルが409 Conflictを返す場合、「AAD-UserReadUsingLogonName」技術プロファイルは呼び出されず、エンドユーザーは続行できません。

関連する問題