설치 종료

  • 릴리스 버전: Yokohama
  • 업데이트 날짜 2025년 01월 30일
  • 읽기6분
  • 설치 엑시트는 Java로 다시 돌아가기 전에 스크립트를 호출하기 위해 Java에서 종료하는 사용자 정의입니다.

    주:
    여기에 설명된 기능을 사용하려면 관리자 역할이 필요합니다.

    사용 가능한 설치 종료

    다음으로 이동 시스템 정의 > 설치 종료. 일부 설치 종료 이름(로그인, 로그아웃, ValidatePassword, ExternalAuthentication)은 예약되어 있으며 변경할 수 없습니다. 다른 설치 종료는 기본 설치 종료의 스크립트를 대체하는 사용자 지정 스크립트로 이를 대체할 수 있습니다.

    기본 시스템에서 다음 설치 종료를 사용할 수 있습니다.

    설치 종료 설명
    로그인 사용자 이름과 암호 쌍을 사용하고 사용자 객체로 인증합니다.
    로그아웃 로그아웃 시 사용자를 시작 페이지로 이동시킵니다. LogoutRedirect에 의해 재정의될 수 있습니다.
    로그아웃 리디렉션 로그아웃 시 사용자를 지정된 URL로 이동시킵니다.
    외부 인증 헤더, 매개변수 또는 쿠키를 사용하여 인증합니다. DigestSingleSignOn 및 PGPSingleSignOn에 의해 재정의될 수 있습니다.
    다이제스트싱글사인온 헤더, 매개변수 또는 쿠키를 사용하여 인증하고 다이제스트 암호화를 해독합니다.
    PGPSingleSignOn 헤더, 매개변수 또는 쿠키를 사용하여 인증하고 PGP 암호화를 해독합니다.
    암호 확인 릴리스부터 기본적으로 활성화됩니다. 고객이 자신의 암호 확인을 정의할 수 있습니다. ValidatePasswordStrongerger로 재정의할 수 있습니다.Helsinki
    ValidatePasswordStronger 비밀번호는 8자 이상이어야 하며 숫자, 대문자 및 소문자를 포함해야 합니다.
    GetIntegrationSessionTimeout 기본 통합 세션 시간 제한 동작을 구현합니다.

    로그인 수정

    로그인 설치 종료를 다음과 같이 수정하면 사용자가 로그인할 때 각 사용자의 세션 제한시간 값이 설정됩니다. 이 특정 예에서 사용자 이름이 admin인 경우 세션은 30초 후 시간 제한으로 설정됩니다.

    gs.include("PrototypeServer");
     
    var Login = Class.create();
    Login.prototype = {
    	initialize : function() {
    	},
     
            process : function() {
              // the request is passed in as a global
              var userName = request.getParameter("user_name");
              var userPassword = request.getParameter("user_password");
     
              var authed = GlideUser.authenticate(userName, userPassword);
              if (authed) {
                 // ***********************************************************        
                 // customization - if the userName == admin, set the session
                 // timeout to be 30 seconds. You can implement your own  
                 // session timeout algorithm here by checking to see if a user
                 // belongs to a certain group or has a certain role.
                 // Values of setMaxInactiveInterval exceeding 1440 minutes are
                 // treated as one day (1440 minutes).
      
               if (userName == "admin") {
                   request.getSession().setMaxInactiveInterval(30);
                 }
                 // ************************************************************
                 return GlideUser.getUser(userName);
              }
     
              this.loginFailed();
     
              return "login.failed";
            },
     
            loginFailed : function() {
              var message = GlideSysMessage.format("login_invalid");
              var gSession = GlideSession.get();
              gSession.addErrorMessage(message);
     
              var userName = request.getParameter("user_name");
              EventManager.queue("login.failed", "", userName, "");
           }
     
    }

    IP 주소에 따라 세션 시간 제한을 설정할 수도 있습니다.

    gs.include("PrototypeServer");
     
    var Login = Class.create();
    Login.prototype = {
    	initialize : function() {
    	},
     
            process : function() {
              // the request is passed in as a global
              var userName = request.getParameter("user_name");
              var userPassword = request.getParameter("user_password");
     
              var authed = GlideUser.authenticate(userName, userPassword);
              if (authed) {
     
              // **************************************************************
              // customization - if the user is logging in from a particular IP
              // range starting with XXX.XXX you can implement your own
              // session timeout algorithm here by checking the login IP
              // 
              // Values of setMaxInactiveInterval exceeding 1440 minutes are
              // treated as one day (1440 minutes).
     
              var clientIP = gs.getSession().getClientIP().toString();
    
              // if client IP starts with specified range
              if (clientIP.indexOf('XXX.XXX') == 0) {  
                 // set to 10 hours
                 request.getSession().setMaxInactiveInterval(60 * 60 * 10); 
              }
              // ***************************************************************
     
                 return GlideUser.getUser(userName);
              }
     
              this.loginFailed();
     
              return "login.failed";
            },
     
            loginFailed : function() {
              var message = GlideSysMessage.format("login_invalid");
              var gSession = GlideSession.get();
              gSession.addErrorMessage(message);
     
              var userName = request.getParameter("user_name");
              EventManager.queue("login.failed", "", userName, "");
           }
     
    }