Exemplo n.º 1
0
        public static ActionResult CheckGithubAuthenticationSettings(Session session)
        {
            session["AUTHENTICATION_SETTINGS_IS_VALID"] = "1";
            try
            {
                AuthenticationValidator authenticationValidator = new GithubAuthenticationValidator();

                string clientId     = GetPropertyStringValue(session, "AUTH_GITHUB_CLIENT_ID");
                string clientSecret = GetPropertyStringValue(session, "AUTH_GITHUB_CLIENT_SECRET");

                authenticationValidator.Validate(clientId, clientSecret);
            }
            catch (Exception e)
            {
                InitializeMessageBox(session, e.Message, ERROR_MESSAGE);
                session["AUTHENTICATION_SETTINGS_IS_VALID"] = "0";
            }

            return(ActionResult.Success);
        }
Exemplo n.º 2
0
        public static ActionResult CheckGithubAuthenticationSettings(Session session)
        {
            session["AUTHENTICATION_SETTINGS_IS_VALID"] = "1";
            try
            {
                AuthenticationValidator authenticationValidator = new GithubAuthenticationValidator();

                string clientId = GetPropertyStringValue(session, "AUTH_GITHUB_CLIENT_ID");
                string clientSecret = GetPropertyStringValue(session, "AUTH_GITHUB_CLIENT_SECRET");

                authenticationValidator.Validate(clientId, clientSecret);
            }
            catch (Exception e)
            {
                InitializeMessageBox(session, e.Message, ERROR_MESSAGE);
                session["AUTHENTICATION_SETTINGS_IS_VALID"] = "0";
            }

            return ActionResult.Success;
        }