org.eclipse.jetty.server.Request.getUserIdentityScope()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(141)

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

Request.getUserIdentityScope介绍

暂无

代码示例

代码示例来源:origin: org.graniteds/granite-server

@Override
public void prelogin(HttpSession session, Object httpRequest, String servletName) {
  if (session == null) // Cannot prelogin() without a session
    return;
  if (session.getAttribute(AuthenticationContext.class.getName()) instanceof Jetty8AuthenticationContext)
    return;
  Request request = (Request)httpRequest;
  Authentication authentication = request.getAuthentication();
  UserIdentity.Scope scope = request.getUserIdentityScope();
  Jetty8AuthenticationContext authorizationContext = new Jetty8AuthenticationContext(scope, authentication);
  session.setAttribute(AuthenticationContext.class.getName(), authorizationContext);
}

代码示例来源:origin: org.graniteds/granite-server

request = (Request)httpRequest;
Authentication authentication = request.getAuthentication();
UserIdentity.Scope scope = request.getUserIdentityScope();

代码示例来源:origin: org.graniteds/granite-server

public Principal login(Object credentials, String charset) throws SecurityServiceException {
  String[] decoded = decodeBase64Credentials(credentials, charset);
  ServletGraniteContext graniteContext = (ServletGraniteContext)GraniteContext.getCurrentInstance();
  Principal principal = null;
  if (graniteContext instanceof HttpGraniteContext) {
    HttpServletRequest httpRequest = graniteContext.getRequest();
    Request request = (Request)httpRequest;
    Authentication authentication = request.getAuthentication();
    UserIdentity.Scope scope = request.getUserIdentityScope();
    Jetty8AuthenticationContext authenticationContext = new Jetty8AuthenticationContext(scope, authentication);
    principal = authenticationContext.authenticate(decoded[0], decoded[1]);
    if (principal != null)
      graniteContext.getSession().setAttribute(AuthenticationContext.class.getName(), authenticationContext);
  }
  else {
    AuthenticationContext authenticationContext = (AuthenticationContext)graniteContext.getSession().getAttribute(AuthenticationContext.class.getName());
    if (authenticationContext != null)
      principal = authenticationContext.authenticate(decoded[0], decoded[1]);
    else
      return null;
  }
  if (principal == null)
    throw SecurityServiceException.newInvalidCredentialsException("Wrong username or password");
  graniteContext.setPrincipal(principal);
  
  endLogin(credentials, charset);
  return principal;
}

代码示例来源:origin: org.graniteds/granite-server

public Principal login(Object credentials, String charset) throws SecurityServiceException {
  String[] decoded = decodeBase64Credentials(credentials, charset);
  ServletGraniteContext graniteContext = (ServletGraniteContext)GraniteContext.getCurrentInstance();
  Principal principal = null;
  if (graniteContext instanceof HttpGraniteContext) {
    HttpServletRequest httpRequest = graniteContext.getRequest();
    Request request = (Request)httpRequest;
    Authentication authentication = request.getAuthentication();
    UserIdentity.Scope scope = request.getUserIdentityScope();
    Jetty9AuthenticationContext authenticationContext = new Jetty9AuthenticationContext(scope, authentication);
    principal = authenticationContext.authenticate(decoded[0], decoded[1]);
    if (principal != null)
      graniteContext.getSession().setAttribute(AuthenticationContext.class.getName(), authenticationContext);
  }
  else {
    AuthenticationContext authenticationContext = (AuthenticationContext)graniteContext.getSession().getAttribute(AuthenticationContext.class.getName());
    if (authenticationContext != null)
      principal = authenticationContext.authenticate(decoded[0], decoded[1]);
    else
      return null;
  }
  if (principal == null)
    throw SecurityServiceException.newInvalidCredentialsException("Wrong username or password");
  graniteContext.setPrincipal(principal);
  
  endLogin(credentials, charset);
  return principal;
}

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

ServletHolder servlet_holder=(ServletHolder) baseRequest.getUserIdentityScope();
FilterChain chain=null;

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

ServletHolder servlet_holder=(ServletHolder) baseRequest.getUserIdentityScope();
FilterChain chain=null;

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

ServletHolder servlet_holder=(ServletHolder) baseRequest.getUserIdentityScope();
FilterChain chain=null;

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

ServletHolder servlet_holder=(ServletHolder) baseRequest.getUserIdentityScope();
FilterChain chain=null;

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

ServletHolder servlet_holder=(ServletHolder) baseRequest.getUserIdentityScope();
FilterChain chain=null;

代码示例来源:origin: Nextdoor/bender

ServletHolder servlet_holder=(ServletHolder) baseRequest.getUserIdentityScope();
FilterChain chain=null;

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.servlet

ServletHolder servlet_holder=(ServletHolder) baseRequest.getUserIdentityScope();
FilterChain chain=null;

代码示例来源:origin: jenkinsci/winstone

throws IOException, ServletException
ServletHolder servlet_holder=(ServletHolder) baseRequest.getUserIdentityScope();
FilterChain chain=null;

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

old_scope=baseRequest.getUserIdentityScope();
baseRequest.setUserIdentityScope(servlet_holder);

代码示例来源:origin: Nextdoor/bender

old_scope=baseRequest.getUserIdentityScope();
baseRequest.setUserIdentityScope(servlet_holder);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

old_scope=baseRequest.getUserIdentityScope();
baseRequest.setUserIdentityScope(servlet_holder);

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.servlet

old_scope=baseRequest.getUserIdentityScope();
baseRequest.setUserIdentityScope(servlet_holder);

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

old_scope=baseRequest.getUserIdentityScope();
baseRequest.setUserIdentityScope(servlet_holder);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

old_scope=baseRequest.getUserIdentityScope();
baseRequest.setUserIdentityScope(servlet_holder);

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

old_scope=baseRequest.getUserIdentityScope();
baseRequest.setUserIdentityScope(servlet_holder);

代码示例来源:origin: jenkinsci/winstone

old_scope=baseRequest.getUserIdentityScope();
baseRequest.setUserIdentityScope(servlet_holder);

相关文章

Request类方法