Class HttpStatusEntryPoint

java.lang.Object
com.codename1.backend.security.HttpStatusEntryPoint
All Implemented Interfaces:
AuthenticationEntryPoint

public final class HttpStatusEntryPoint extends Object implements AuthenticationEntryPoint

Answers with a status and a body in the shape of Spring Boot's default error body: new HttpStatusEntryPoint(401) for an API whose clients know how to authenticate without being told.

The body is {"timestamp":..,"status":401,"error":"Unauthorized","path":"/x"}, the shape of Boot's /error responses. This differs from Spring on purpose: Spring's entry point only sets the status, so Boot sends no body. An empty body broke clients that read the error body -- a Codename One client's RequestBuilder reports an error code while reading it, so with Content-Length: 0 no error callback ever saw the 401 (issue 6353).