All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ec.gob.senescyt.sniese.commons.exceptions.mappers.ExcepcionAutenticacionMapper Maven / Gradle / Ivy

There is a newer version: 2.0.5
Show newest version
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