use of org.springframework.web.bind.annotation.GetMapping in project cas by apereo.
the class TrustedDevicesController method getRecords.
/**
* Gets records.
*
* @param request the request
* @param response the response
* @return the records
*/
@GetMapping(value = "/getRecords")
@ResponseBody
public Set<MultifactorAuthenticationTrustRecord> getRecords(final HttpServletRequest request, final HttpServletResponse response) {
ensureEndpointAccessIsAuthorized(request, response);
final TrustedDevicesMultifactorProperties trusted = casProperties.getAuthn().getMfa().getTrusted();
final LocalDate onOrAfter = LocalDate.now().minus(trusted.getExpiration(), DateTimeUtils.toChronoUnit(trusted.getTimeUnit()));
this.mfaTrustEngine.expire(onOrAfter);
return this.mfaTrustEngine.get(onOrAfter);
}
use of org.springframework.web.bind.annotation.GetMapping in project cas by apereo.
the class CasConsentReviewController method showConsent.
/**
* Show consent decisions.
*
* @param request the request
* @param response the response
* @return the view where json data will be rendered
*/
@GetMapping
public ModelAndView showConsent(final HttpServletRequest request, final HttpServletResponse response) {
final ModelAndView view = new ModelAndView(CONSENT_REVIEW_VIEW);
view.getModel().put("principal", Pac4jUtils.getPac4jAuthenticatedUsername());
return view;
}
use of org.springframework.web.bind.annotation.GetMapping in project uhgroupings by uhawaii-system-its-ti-iam.
the class HomeController method feedbackError.
@PreAuthorize("isAuthenticated()")
@GetMapping("/feedback/{error}")
public String feedbackError(RedirectAttributes redirectAttributes, @PathVariable String error) {
Feedback feedback = new Feedback(error);
redirectAttributes.addFlashAttribute("feedback", feedback);
return "redirect:/feedback";
}
use of org.springframework.web.bind.annotation.GetMapping in project code-chill by CodeChillAlluna.
the class UserController method resetPassword.
@GetMapping(value = "/reset/{token}")
public ResponseEntity<?> resetPassword(@PathVariable("token") String token) {
HttpHeaders responseHeaders = new HttpHeaders();
User user = urepo.findByTokenPassword(token);
Date currentDate = new Date();
Calendar c = Calendar.getInstance();
c.setTime(user.getLastPasswordResetDate());
c.add(Calendar.DATE, 1);
Date currentDatePlusOne = c.getTime();
if (user != null) {
if (currentDate.after(user.getLastPasswordResetDate()) && currentDate.before(currentDatePlusOne)) {
return ResponseEntity.ok().headers(responseHeaders).body(user);
}
}
return ResponseEntity.badRequest().headers(responseHeaders).body(null);
}
use of org.springframework.web.bind.annotation.GetMapping in project sic by belluccifranco.
the class PagoController method getPagosPorCajaYFormaDePago.
@GetMapping("/pagos/busqueda")
@ResponseStatus(HttpStatus.OK)
public List<Pago> getPagosPorCajaYFormaDePago(@RequestParam long idEmpresa, @RequestParam long idFormaDePago, @RequestParam long desde, @RequestParam long hasta) {
Date fechaDesde = new Date(desde);
Date fechaHasta = new Date(hasta);
return pagoService.getPagosEntreFechasYFormaDePago(idEmpresa, idFormaDePago, fechaDesde, fechaHasta);
}
Aggregations