1 28 29 package com.caucho.server.security; 30 31 import com.caucho.security.BasicPrincipal; 32 33 import javax.servlet.ServletContext ; 34 import javax.servlet.ServletException ; 35 import javax.servlet.http.HttpServletRequest ; 36 import javax.servlet.http.HttpServletResponse ; 37 import java.security.Principal ; 38 39 42 public class NullAuthenticator extends AbstractAuthenticator { 43 public Principal loginImpl(HttpServletRequest request, 44 HttpServletResponse response, 45 ServletContext app, 46 String user, String password) 47 throws ServletException 48 { 49 return new BasicPrincipal(user); 50 } 51 52 public Principal getUserPrincipalImpl(HttpServletRequest request, 53 ServletContext application) 54 throws ServletException 55 { 56 return null; 57 } 58 59 66 public boolean isUserInRole(HttpServletRequest request, 67 HttpServletResponse response, 68 ServletContext application, 69 Principal user, String role) 70 throws ServletException 71 { 72 return user != null && "user".equals(role); 73 } 74 } 75 | Popular Tags |