Merge "Provide a more descriptive error message for unauthenticated REST API"
This commit is contained in:
@@ -745,7 +745,7 @@ public class RestApiServlet extends HttpServlet {
|
|||||||
if (user instanceof AnonymousUser) {
|
if (user instanceof AnonymousUser) {
|
||||||
throw new AuthException("Authentication required");
|
throw new AuthException("Authentication required");
|
||||||
} else if (!globals.webSession.get().isAccessPathOk(AccessPath.REST_API)) {
|
} else if (!globals.webSession.get().isAccessPathOk(AccessPath.REST_API)) {
|
||||||
throw new AuthException("Invalid authentication method");
|
throw new AuthException("Invalid authentication method. In order to authenticate, prefix the REST endpoint URL with /a/ (e.g. http://example.com/a/projects/).");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
user.setAccessPath(AccessPath.REST_API);
|
user.setAccessPath(AccessPath.REST_API);
|
||||||
|
|||||||
Reference in New Issue
Block a user