ec.gob.senescyt.sniese.commons.exceptions.mappers.ExcepcionAutenticacionMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sniese-commons Show documentation
Show all versions of sniese-commons Show documentation
Librería que contiene clases de uso comun para sniese hechos en dropwizard
package ec.gob.senescyt.sniese.commons.exceptions.mappers;
import org.apache.shiro.authz.AuthorizationException;
import org.eclipse.jetty.http.HttpStatus;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
public class ExcepcionAutenticacionMapper implements ExceptionMapper {
private static final String MENSAJE_CREDENCIALES_INCORRECTAS = "Credenciales incorrectas";
@Override
public Response toResponse(AuthorizationException exception) {
return Response.status(HttpStatus.UNAUTHORIZED_401)
.entity(MENSAJE_CREDENCIALES_INCORRECTAS)
.build();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy