void OnLogin(object sender, EventArgs e)
        {
            IUserManager userManager = UserManagerProviderFactory.CreateUserManager(); // new AspNetSqlProviderService(m_Url);
            bool         isInRole    = false;

            isInRole = userManager.IsInRole(m_ApplicationTextBox.Text, m_UserComboBox.Text, m_RoleComboBox.Text);
            if (isInRole)
            {
                MessageBox.Show(this, "Successful Authorization", "Credentials Manager", MessageBoxButtons.OK);
            }
            else
            {
                MessageBox.Show(this, "User is not a member of the specified role", "Credentials Manager", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }
Exemple #2
0
        void OnLogin(object sender, EventArgs e)
        {
            IUserManager userManager   = UserManagerProviderFactory.CreateUserManager(); // new AspNetSqlProviderService(m_Url);
            bool         authenticated = false;

            authenticated = userManager.Authenticate(m_ApplicationTextBox.Text, m_UserNameTextBox.Text, m_PasswordTextBox.Text);
            if (authenticated)
            {
                MessageBox.Show(this, "Successful Authentication", "Credentials Manager", MessageBoxButtons.OK);
            }
            else
            {
                MessageBox.Show(this, "Incorrect Credentials", "Credentials Manager", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }