org.apache.catalina.authenticator.AuthenticatorBase.register()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中org.apache.catalina.authenticator.AuthenticatorBase.register()方法的一些代码示例,展示了AuthenticatorBase.register()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AuthenticatorBase.register()方法的具体详情如下:
包路径:org.apache.catalina.authenticator.AuthenticatorBase
类名称:AuthenticatorBase
方法名:register

AuthenticatorBase.register介绍

[英]Register an authenticated Principal and authentication type in our request, in the current session (if there is one), and with our SingleSignOn valve, if there is one. Set the appropriate cookie to be returned.
[中]在当前会话(如果有)和SingleSignOn阀(如果有)中,在请求中注册经过身份验证的主体和身份验证类型。设置要返回的相应cookie。

代码示例

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * Register an authenticated Principal and authentication type in our
 * request, in the current session (if there is one), and with our
 * SingleSignOn valve, if there is one. Set the appropriate cookie to be
 * returned.
 *
 * @param request
 *            The servlet request we are processing
 * @param response
 *            The servlet response we are generating
 * @param principal
 *            The authenticated Principal to be registered
 * @param authType
 *            The authentication type to be registered
 * @param username
 *            Username used to authenticate (if any)
 * @param password
 *            Password used to authenticate (if any)
 */
public void register(Request request, HttpServletResponse response, Principal principal,
    String authType, String username, String password) {
  register(request, response, principal, authType, username, password, alwaysUseSession, cache);
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Register an authenticated Principal and authentication type in our
 * request, in the current session (if there is one), and with our
 * SingleSignOn valve, if there is one. Set the appropriate cookie to be
 * returned.
 *
 * @param request
 *            The servlet request we are processing
 * @param response
 *            The servlet response we are generating
 * @param principal
 *            The authenticated Principal to be registered
 * @param authType
 *            The authentication type to be registered
 * @param username
 *            Username used to authenticate (if any)
 * @param password
 *            Password used to authenticate (if any)
 */
public void register(Request request, HttpServletResponse response, Principal principal,
    String authType, String username, String password) {
  register(request, response, principal, authType, username, password, alwaysUseSession, cache);
}

代码示例来源:origin: codefollower/Tomcat-Research

@Override
public void logout(Request request) {
  register(request, request.getResponse(), null,
      null, null, null);
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

@Override
public void logout(Request request) throws ServletException {
  register(request, request.getResponse(), null,
      null, null, null);
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

@Override
public void logout(Request request) throws ServletException {
  register(request, request.getResponse(), null,
      null, null, null);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

@Override
public void logout(Request request) throws ServletException {
  register(request, request.getResponse(), null,
      null, null, null);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
public void logout(Request request) throws ServletException {
  register(request, request.getResponse(), null,
      null, null, null);
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
public void logout(Request request) throws ServletException {
  register(request, request.getResponse(), null,
      null, null, null);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

@Override
public void login(String username, String password, Request request)
    throws ServletException {
  Principal principal = doLogin(request, username, password);
  register(request, request.getResponse(), principal,
        getAuthMethod(), username, password);
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

@Override
public void login(String username, String password, Request request) throws ServletException {
  Principal principal = doLogin(request, username, password);
  register(request, request.getResponse(), principal, getAuthMethod(), username, password);
}

代码示例来源:origin: codefollower/Tomcat-Research

@Override
public void login(String username, String password, Request request)
    throws ServletException {
  Principal principal = doLogin(request, username, password);
  register(request, request.getResponse(), principal,
        getAuthMethod(), username, password);
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

@Override
public void login(String username, String password, Request request)
    throws ServletException {
  Principal principal = doLogin(request, username, password);
  register(request, request.getResponse(), principal,
        getAuthMethod(), username, password);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
public void login(String username, String password, Request request)
    throws ServletException {
  Principal principal = doLogin(request, username, password);
  register(request, request.getResponse(), principal,
        getAuthMethod(), username, password);
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

@Override
public void login(String username, String password, Request request)
    throws ServletException {
  Principal principal = doLogin(request, username, password);
  register(request, request.getResponse(), principal,
        getAuthMethod(), username, password);
}

代码示例来源:origin: org.glassfish.main.web/web-core

@Override
public void login(String username, char[] password, HttpRequest request)
    throws ServletException {
  Principal principal = doLogin(request, username, password);
  register(request, (HttpResponse)request.getResponse(), principal,
      getAuthMethod(), username, password);
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

@Override
public void login(String username, String password, Request request) throws ServletException {
  Principal principal = doLogin(request, username, password);
  register(request, request.getResponse(), principal, getAuthMethod(), username, password);
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
public void login(String username, String password, Request request)
    throws ServletException {
  Principal principal = doLogin(request, username, password);
  register(request, request.getResponse(), principal,
        getAuthMethod(), username, password);
}

代码示例来源:origin: org.glassfish.main.web/web-core

@Override
public void logout(HttpRequest request) throws ServletException {
  Session session = getSession(request);
  if (session != null) {
    session.setPrincipal(null);
    session.setAuthType(null);
  }
  // principal and authType set to null in the following
  register(request, (HttpResponse)request.getResponse(), null,
      null, null, null);
}

代码示例来源:origin: jboss.web/jbossweb

public void login(Request request, String username, String password)
  throws ServletException {
  
  // Is there an SSO session against which we can try to reauthenticate?
  String ssoId = (String) request.getNote(Constants.REQ_SSOID_NOTE);
  if (ssoId != null) {
    if (log.isDebugEnabled())
      log.debug("SSO Id " + ssoId + " set; attempting " +
           "reauthentication");
    /* Try to reauthenticate using data cached by SSO.  If this fails,
      either the original SSO logon was of DIGEST or SSL (which
      we can't reauthenticate ourselves because there is no
      cached username and password), or the realm denied
      the user's reauthentication for some reason.
      In either case we have to prompt the user for a logon */
    if (reauthenticateFromSSO(ssoId, request))
      return;
  }
  Realm realm = context.getRealm();
  Principal principal = realm.authenticate(username, password);
  if (principal != null) {
    register(request, request.getResponseFacade(), principal, Constants.LOGIN_METHOD,
         username, password);
  }
}

代码示例来源:origin: org.jboss.web/jbossweb

public void login(Request request, String username, String password)
  throws ServletException {
  
  // Is there an SSO session against which we can try to reauthenticate?
  String ssoId = (String) request.getNote(Constants.REQ_SSOID_NOTE);
  if (ssoId != null) {
    if (CatalinaLogger.AUTH_LOGGER.isDebugEnabled())
      CatalinaLogger.AUTH_LOGGER.debug("SSO Id " + ssoId + " set; attempting " +
           "reauthentication");
    /* Try to reauthenticate using data cached by SSO.  If this fails,
      either the original SSO logon was of DIGEST or SSL (which
      we can't reauthenticate ourselves because there is no
      cached username and password), or the realm denied
      the user's reauthentication for some reason.
      In either case we have to prompt the user for a logon */
    if (reauthenticateFromSSO(ssoId, request))
      return;
  }
  Realm realm = context.getRealm();
  Principal principal = realm.authenticate(username, password);
  if (principal != null) {
    register(request, request.getResponseFacade(), principal, Constants.LOGIN_METHOD,
         username, password);
  }
}

相关文章

微信公众号

最新文章

更多