Esempio n. 1
0
        internal static string GetAuthenticatorProfile(IAuthenticatorEnrollment authenticatorEnrollment)
        {
            if (authenticatorEnrollment.Key == AuthenticatorType.Phone.ToIdxKeyString())
            {
                return(authenticatorEnrollment.Profile?.GetProperty <string>("phoneNumber"));
            }
            else if (authenticatorEnrollment.Key == AuthenticatorType.Email.ToIdxKeyString())
            {
                return(authenticatorEnrollment.Profile?.GetProperty <string>("email"));
            }

            return(string.Empty);
        }
Esempio n. 2
0
 internal static IAuthenticator ConvertToAuthenticator(IList <IAuthenticatorValue> authenticators, IAuthenticatorEnrollment authenticatorEnrollment)
 => new Authenticator
 {
     Id           = authenticators?.FirstOrDefault(x => x.Key == authenticatorEnrollment.Key)?.Id,
     Name         = authenticatorEnrollment.DisplayName,
     MethodTypes  = authenticatorEnrollment.Methods?.Select(x => x.Type).ToList(),
     EnrollmentId = authenticatorEnrollment.Id,
     Profile      = GetAuthenticatorProfile(authenticatorEnrollment),
 };