Ejemplo n.º 1
0
        /// <summary>
        /// RemoveUserStoredCredentials method implementation
        /// </summary>
        internal static void RemoveUserStoredCredentials(string upn, string credentialid)
        {
            IExternalProvider prov = RuntimeAuthProvider.GetProvider(PreferredMethod.Biometrics);
            IWebAuthNProvider web  = prov as IWebAuthNProvider;

            web.RemoveUserStoredCredentials(upn, credentialid);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// GetUserStoredCredentials method implementation
        /// </summary>
        internal static List <WebAuthNCredentialInformation> GetUserStoredCredentials(string upn)
        {
            IExternalProvider prov = RuntimeAuthProvider.GetProvider(PreferredMethod.Biometrics);
            IWebAuthNProvider web  = prov as IWebAuthNProvider;

            return(web.GetUserStoredCredentials(upn));
        }
 /// <summary>
 /// GetProvider method implementation
 /// </summary>
 public static IExternalProvider GetProvider(PreferredMethod method)
 {
     return(RuntimeAuthProvider.GetProvider(method));
 }
Ejemplo n.º 4
0
        /// <summary>
        /// CanApplyDataChanges method implementation
        /// </summary>
        private bool CanApplyDataChanges(Registration registration)
        {
            bool result = true;

            if (registration.IsApplied)
            {
                return(result);
            }
            IExternalProvider prov1 = RuntimeAuthProvider.GetProvider(PreferredMethod.Code);

            if ((prov1.Enabled) && (prov1.IsRequired))
            {
                if (string.IsNullOrEmpty(registration.UPN))
                {
                    MessageBoxParameters messageBoxParameters = new MessageBoxParameters();
                    messageBoxParameters.Text    = res.PPAGEVALIDUSER;
                    messageBoxParameters.Buttons = MessageBoxButtons.OK;
                    messageBoxParameters.Icon    = MessageBoxIcon.Error;
                    ParentSheet.ShowDialog(messageBoxParameters);
                    ParentSheet.SetActivePage(0);
                    result = false;
                }
                else if (string.IsNullOrEmpty(MMCService.GetEncodedUserKey(registration.UPN)))
                {
                    MessageBoxParameters messageBoxParameters = new MessageBoxParameters();
                    messageBoxParameters.Text    = res.PPAGEVALIDKEY;
                    messageBoxParameters.Buttons = MessageBoxButtons.OK;
                    messageBoxParameters.Icon    = MessageBoxIcon.Error;
                    ParentSheet.ShowDialog(messageBoxParameters);
                    ParentSheet.SetActivePage(1);
                    result = false;
                }
            }
            IExternalProvider prov2 = RuntimeAuthProvider.GetProvider(PreferredMethod.Email);

            if ((prov2.Enabled) && (prov2.IsRequired))
            {
                if (string.IsNullOrEmpty(registration.MailAddress))
                {
                    MessageBoxParameters messageBoxParameters = new MessageBoxParameters();
                    messageBoxParameters.Text    = res.PPAGEVALIDMAIL;
                    messageBoxParameters.Buttons = MessageBoxButtons.YesNo;
                    messageBoxParameters.Icon    = MessageBoxIcon.Warning;
                    if (ParentSheet.ShowDialog(messageBoxParameters) == DialogResult.Yes)
                    {
                        result = true;
                    }
                    else
                    {
                        result = false;
                        ParentSheet.SetActivePage(0);
                    }
                }
                else if (!MMCService.IsValidEmail(registration.MailAddress))
                {
                    MessageBoxParameters messageBoxParameters = new MessageBoxParameters();
                    messageBoxParameters.Text    = res.PPAGEINVALIDMAIL;
                    messageBoxParameters.Buttons = MessageBoxButtons.OK;
                    messageBoxParameters.Icon    = MessageBoxIcon.Error;
                    ParentSheet.ShowDialog(messageBoxParameters);
                    ParentSheet.SetActivePage(0);
                    result = false;
                }
            }
            IExternalProvider prov3 = RuntimeAuthProvider.GetProvider(PreferredMethod.External);

            if ((prov3.Enabled) && (prov3.IsRequired))
            {
                if (string.IsNullOrEmpty(registration.PhoneNumber))
                {
                    MessageBoxParameters messageBoxParameters = new MessageBoxParameters();
                    messageBoxParameters.Text    = res.PPAGEVALIDPHONE;
                    messageBoxParameters.Buttons = MessageBoxButtons.YesNo;
                    messageBoxParameters.Icon    = MessageBoxIcon.Warning;
                    if (ParentSheet.ShowDialog(messageBoxParameters) == DialogResult.Yes)
                    {
                        result = true;
                    }
                    else
                    {
                        result = false;
                        ParentSheet.SetActivePage(0);
                    }
                }
                else if (!MMCService.IsValidPhone(registration.PhoneNumber))
                {
                    MessageBoxParameters messageBoxParameters = new MessageBoxParameters();
                    messageBoxParameters.Text    = res.PPAGEINVALIDPHONE;
                    messageBoxParameters.Buttons = MessageBoxButtons.OK;
                    messageBoxParameters.Icon    = MessageBoxIcon.Error;
                    ParentSheet.ShowDialog(messageBoxParameters);
                    ParentSheet.SetActivePage(0);
                    result = false;
                }
            }
            return(result);
        }