private async Task RetrieveTwoFactorInfoAsync()

in src/Amazon.AspNetCore.Identity.Cognito/CognitoSigninManager.cs [409:423]


        private async Task<TwoFactorAuthenticationInfo> RetrieveTwoFactorInfoAsync()
        {
            var result = await Context.AuthenticateAsync(IdentityConstants.TwoFactorUserIdScheme).ConfigureAwait(false);
            if (result?.Principal != null)
            {
                return new TwoFactorAuthenticationInfo
                {
                    UserId = result.Principal.FindFirstValue(ClaimTypes.Name),
                    LoginProvider = result.Principal.FindFirstValue(ClaimTypes.AuthenticationMethod),
                    CognitoAuthenticationWorkflowId = result.Principal.FindFirstValue(Cognito2FAAuthWorkflowKey),
                    ChallengeNameType = result.Principal.FindFirstValue(Cognito2FAChallengeNameType)
                };
            }
            return null;
        }