@Override
    public Response toResponse(UnauthenticatedException exception) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("unauthenticated.", exception);
        }

        return Response.status(Status.UNAUTHORIZED).build();
    }
JAX-RS exception mapper used to map Shiro {@link UnauthenticatedException} to HTTP status codes.
{@link UnauthenticatedException} will be mapped to 401.

@since 1.4
support/jaxrs/src/main/java/org/apache/shiro/web/jaxrs/UnauthenticatedExceptionExceptionMapper.java