Skip to content

Commit

Permalink
Merge pull request #555 from azure-ad-b2c/abdeswal/totpSampleUpdate
Browse files Browse the repository at this point in the history
Update TrustFrameworkExtensions_TOTP
  • Loading branch information
abdeswal authored Jul 19, 2023
2 parents 4dd55f6 + 2f91976 commit e7d6085
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
35 changes: 32 additions & 3 deletions policies/totp/policy/TrustFrameworkExtensions_TOTP.xml
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@
<OutputClaim ClaimTypeReferenceId="otpCode" Required="true" />
</OutputClaims>
<ValidationTechnicalProfiles>
<ValidationTechnicalProfile ReferenceId="AzureMfa-BeginVerifyOTP" />
<ValidationTechnicalProfile ReferenceId="AzureMfa-VerifyOTP" />
</ValidationTechnicalProfiles>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-MFA-TOTP" />
Expand Down Expand Up @@ -762,8 +761,23 @@
</OrchestrationStep>

<!-- If the number of available devices isn't zero (user has enrolled before),
render the TOTP verification page -->
begin the TOTP verification session -->
<OrchestrationStep Order="3" Type="ClaimsExchange">
<Preconditions>
<Precondition Type="ClaimEquals" ExecuteActionsIf="true">
<Value>numberOfAvailableDevices</Value>
<Value>0</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<ClaimsExchanges>
<ClaimsExchange Id="AuthenticatorForSignInBeginSession" TechnicalProfileReferenceId="AzureMfa-BeginVerifyOTP" />
</ClaimsExchanges>
</OrchestrationStep>

<!-- If the number of available devices isn't zero (user has enrolled before),
render the TOTP verification page -->
<OrchestrationStep Order="4" Type="ClaimsExchange">
<Preconditions>
<Precondition Type="ClaimEquals" ExecuteActionsIf="true">
<Value>numberOfAvailableDevices</Value>
Expand Down Expand Up @@ -820,8 +834,23 @@
</OrchestrationStep>

<!-- If the number of available devices is zero (user hasn't enrolled before),
render the TOTP verification page. -->
begin the TOTP verification session. -->
<OrchestrationStep Order="4" Type="ClaimsExchange">
<Preconditions>
<Precondition Type="ClaimEquals" ExecuteActionsIf="false">
<Value>numberOfAvailableDevices</Value>
<Value>0</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<ClaimsExchanges>
<ClaimsExchange Id="AuthenticatorForSignInBeginSession" TechnicalProfileReferenceId="AzureMfa-BeginVerifyOTP" />
</ClaimsExchanges>
</OrchestrationStep>

<!-- If the number of available devices is zero (user hasn't enrolled before),
render the TOTP verification page. -->
<OrchestrationStep Order="5" Type="ClaimsExchange">
<Preconditions>
<Precondition Type="ClaimEquals" ExecuteActionsIf="false">
<Value>numberOfAvailableDevices</Value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<SubJourney Id="TotpFactor-Verify" Type="Call">
<OrchestrationSteps>
<!-- Additional step to call JIT TOTP Registration -->
<OrchestrationStep Order="4" Type="ClaimsExchange">
<OrchestrationStep Order="5" Type="ClaimsExchange">
<Preconditions>
<Precondition Type="ClaimsExist" ExecuteActionsIf="false">
<Value>extension_StrongAuthenticationAppSecretKey</Value>
Expand All @@ -111,7 +111,7 @@
</OrchestrationStep>
<!-- Additional Step to remove the lgacy TOTP Claim. -->
<!-- Comment out this Orchestration Step if you would like to retain the old secrets.-->
<OrchestrationStep Order="5" Type="ClaimsExchange">
<OrchestrationStep Order="6" Type="ClaimsExchange">
<Preconditions>
<Precondition Type="ClaimsExist" ExecuteActionsIf="false">
<Value>extension_StrongAuthenticationAppSecretKey</Value>
Expand Down
2 changes: 1 addition & 1 deletion policies/totp/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The below diagram depicts how the Just In Time TOTP migration works:

### Remove legacy TOTP secret claim

Within the [TOTP Migration Extension](policy/TrustFrameworkExtensions_TOTPMigration.xml) file under the *TotpFactor-Verify* sub journey, orchestration Step 5 will call the delete legacy TOTP Secret technical profile (AAD-DeleteLegacyTOTPClaim). This call by default has 2 conditions.
Within the [TOTP Migration Extension](policy/TrustFrameworkExtensions_TOTPMigration.xml) file under the *TotpFactor-Verify* sub journey, orchestration Step 6 will call the delete legacy TOTP Secret technical profile (AAD-DeleteLegacyTOTPClaim). This call by default has 2 conditions.

1. The extension attribute used to store the legacy claim needs to exist.
2. The number of registered devices is not 0
Expand Down

0 comments on commit e7d6085

Please sign in to comment.