Пример #1
0
        public static ActionResult CheckGoogleAuthenticationSettings(Session session)
        {
            session["AUTHENTICATION_SETTINGS_IS_VALID"] = "1";
            try
            {
                AuthenticationValidator authenticationValidator = new GoogleAuthenticationProviderValidator();

                string clientId     = GetPropertyStringValue(session, "AUTH_GOOGLE_CLIENT_ID");
                string clientSecret = GetPropertyStringValue(session, "AUTH_GOOGLE_CLIENT_SECRET");

                authenticationValidator.Validate(clientId, clientSecret);
            }
            catch (Exception e)
            {
                InitializeMessageBox(session, e.Message, ERROR_MESSAGE);
                session["AUTHENTICATION_SETTINGS_IS_VALID"] = "0";
            }
            return(ActionResult.Success);
        }
Пример #2
0
        public static ActionResult CheckGoogleAuthenticationSettings(Session session)
        {
            session["AUTHENTICATION_SETTINGS_IS_VALID"] = "1";
            try
            {
                AuthenticationValidator authenticationValidator = new GoogleAuthenticationProviderValidator();

                string clientId = GetPropertyStringValue(session, "AUTH_GOOGLE_CLIENT_ID");
                string clientSecret = GetPropertyStringValue(session, "AUTH_GOOGLE_CLIENT_SECRET");

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