List of usage examples for org.springframework.http HttpStatus UNAUTHORIZED
HttpStatus UNAUTHORIZED
To view the source code for org.springframework.http HttpStatus UNAUTHORIZED.
Click Source Link
From source file:fr.esiea.windmeal.controller.exception.security.InvalidLoginException.java
public InvalidLoginException() { super(HttpStatus.UNAUTHORIZED.value(), 0); }
From source file:com.mycompany.gis2.resource.AdministratorzyResource.java
@RequestMapping(value = "/admin", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity isCorrect(@RequestBody Administratorzy admin) { Administratorzy adminRep = adminRepository.findOneByLogin(admin.getLogin()); return (admin.getHaslo().equals(adminRep.getHaslo())) ? new ResponseEntity(HttpStatus.OK) : new ResponseEntity(HttpStatus.UNAUTHORIZED); }
From source file:fr.esiea.esieaddress.service.exception.security.InvalidLoginException.java
public InvalidLoginException() { super(HttpStatus.UNAUTHORIZED.value(), Collections.EMPTY_MAP); }
From source file:fr.esiea.esieaddress.service.exception.security.NeedToBeAuthenticatedException.java
public NeedToBeAuthenticatedException() { super(HttpStatus.UNAUTHORIZED.value(), Collections.EMPTY_MAP); }
From source file:net.gplatform.sudoor.server.springboot.SudoorServletContainerCustomizer.java
@Override public void customize(ConfigurableEmbeddedServletContainer container) { // This is to return null for 401, so that error will send to client directly ErrorPage errorPage401 = new ErrorPage(HttpStatus.UNAUTHORIZED, null); container.addErrorPages(errorPage401); }
From source file:com.github.marceloverdijk.spring.security.jwt.web.JwtAuthenticationEntryPoint.java
@Override public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { HttpStatus unauthorized = HttpStatus.UNAUTHORIZED; response.sendError(unauthorized.value(), unauthorized.getReasonPhrase()); }
From source file:fr.esiea.windmeal.controller.exception.security.NeedToBeAuthenticatedException.java
public NeedToBeAuthenticatedException() { super(HttpStatus.UNAUTHORIZED.value(), null); }
From source file:sparklr.common.AbstractProtectedResourceTests.java
@Test public void testBeansResourceIsProtected() throws Exception { ResponseEntity<String> response = http.getForString("/admin/beans"); assertEquals(HttpStatus.UNAUTHORIZED, response.getStatusCode()); assertTrue("Wrong header: " + response.getHeaders(), response.getHeaders().getFirst("WWW-Authenticate").startsWith("Bearer realm=")); }
From source file:com.redblackit.web.controller.SecurityController.java
/** * Authentication error handling.//from ww w .j a v a 2 s . c o m * * For now we log, then fire up the login page with an appropriate message parameter * * @param model */ @RequestMapping("/loginError") @ResponseStatus(value = HttpStatus.UNAUTHORIZED) public String loginError(Model model) { logger.warn("login error"); model.addAttribute("login_error", "login.unsuccessful"); return "login"; }
From source file:com.sentinel.web.controllers.LoginController.java
@RequestMapping(method = RequestMethod.GET, value = "/all/login_failure") public @ResponseBody ResponseEntity<String> handleLoginFailure(Principal principal) { return new ResponseEntity<>("Login failed", HttpStatus.UNAUTHORIZED); }