ToastShaman / dropwizard-auth-jwt

A Dropwizard authentication filter using JSON Web Token (JWT)
Apache License 2.0
116 stars 50 forks source link

Changing error message when JWT expires #36

Open alessandroderoma opened 6 years ago

alessandroderoma commented 6 years ago

I tried the GET example on a secured resource:

@GET
@Produces(MediaType.APPLICATION_JSON)
public DefaultJwtCookiePrincipal getPrincipal(@Auth DefaultJwtCookiePrincipal principal) {
    return principal;
}

When the current JWT is valid I get a correct JSON, when it's expired I get Credentials are required to access this resource., and the response gets transferred as text, making the httpclient (which expects a JSON output from the service) to fail.

How can I solve this?