List of usage examples for javax.servlet.http HttpServletRequest getRemoteUser
public String getRemoteUser();
null
if the user has not been authenticated. From source file:com.sun.socialsite.web.filters.SessionFilter.java
/** * *//*from w ww .j a va 2 s . co m*/ public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpReq = (HttpServletRequest) req; String remoteUser = httpReq.getRemoteUser(); if (remoteUser != null) { HttpSession httpSession = httpReq.getSession(); if (httpSession.getAttribute(REMOTE_USER) == null) { log.debug( String.format("Setting REMOTE_USER=%s on Session[id=%s]", remoteUser, httpSession.getId())); httpSession.setAttribute(REMOTE_USER, remoteUser); } assert (httpSession.equals(SessionListener.getSession(httpSession.getId()))); } chain.doFilter(req, resp); }
From source file:org.watterssoft.appsupport.ticket.ui.TicketController.java
@RequestMapping(value = "/addTicket", method = RequestMethod.POST) public String addTicket(@RequestBody TicketDTO ticketDTO, HttpServletRequest request) { ticketService.convertAndSaveTicketDTO(ticketDTO, request.getRemoteUser()); return getTicketPartialPage(); }
From source file:org.openlaszlo.auth.RoleAuthentication.java
public String getUsername(HttpServletRequest req, HttpServletResponse res, HashMap param) { mLogger.debug("getUsername(req,res,param)"); return req.getRemoteUser(); }
From source file:com.arvato.thoroughly.filter.AccessLogFilter.java
@Override public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain chain) throws ServletException, IOException { ServletRequest requestWrapper = arg0; try {//from ww w. j a v a2s . co m final HttpServletRequest request = (HttpServletRequest) arg0; final String username = request.getRemoteUser(); LOGGER.trace("Username : " + username); final String ip = HttpHelper.getIpAddress(request); LOGGER.trace("Client ip is : " + ip); final StringBuffer URL = request.getRequestURL(); LOGGER.trace("URL of the client request is : " + URL.toString()); requestWrapper = new FilterRequestWrapper(request); String body = IOUtils.toString(requestWrapper.getInputStream()); LOGGER.trace("Request body is : " + body); } catch (Exception e) { LOGGER.error("An error occurred inside AccessLogFilter:" + e.getMessage()); } chain.doFilter(requestWrapper, arg1); }
From source file:com.boaglio.controller.IndexController.java
@GetMapping("/hello") public String hello(Map<String, Object> model, HttpServletRequest httpServletRequest) { String sessionID = RequestContextHolder.currentRequestAttributes().getSessionId(); String user = httpServletRequest.getRemoteUser(); model.put("sessionID", sessionID); System.out.println("------------------------------------------"); System.out.println(" sessionID = " + sessionID); System.out.println(" user = " + user); return "hello"; }
From source file:alpha.portal.webapp.controller.CaseMenuController.java
/** * handles the incoming request./*w w w . ja v a 2 s . c o m*/ * * @param request * the request * @return ModelView * @throws Exception * the exception */ @RequestMapping(method = RequestMethod.GET) public ModelAndView handleRequest(final HttpServletRequest request) throws Exception { final User currentUser = this.userManager.getUserByUsername(request.getRemoteUser()); return new ModelAndView().addObject("caseList", this.caseManager.findByParticipant(currentUser)); }
From source file:com.liferay.portal.util.PortalUtil.java
public static String getAuthorizedPath(HttpServletRequest req) { String userId = getUserId(req); if ((userId == null) && (req.getRemoteUser() == null)) { return PUBLIC_PATH; } else {// w w w .j a v a 2 s .c o m return StringPool.BLANK; } }
From source file:gov.nih.nci.ncicb.cadsr.common.security.LogoutServlet.java
private boolean isLoggedIn(HttpServletRequest request) { String user = request.getRemoteUser(); if (user == null) { return false; }/*from www . j a v a2 s .co m*/ if ("".equals(user)) { return false; } return true; }
From source file:org.jasig.schedassist.web.security.RemoteUserAuthenticationProcessingFilterImpl.java
public Authentication attemptAuthentication(final HttpServletRequest request, final HttpServletResponse response) throws AuthenticationException { String username = request.getRemoteUser(); String password = ""; UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(username, password);/*from w w w . ja v a 2 s . co m*/ authRequest.setDetails(authenticationDetailsSource.buildDetails((HttpServletRequest) request)); return this.getAuthenticationManager().authenticate(authRequest); }
From source file:org.watterssoft.appsupport.ticket.ui.TicketController.java
@RequestMapping(value = "/new", method = RequestMethod.GET) public @ResponseBody TicketDTO newTicket(HttpServletRequest request) { List<ApplicationDTO> applications = applicationService.getAllUserApplicationDTO(request.getRemoteUser()); return new TicketDTO(applications); }