- try {
- if (!MusicAuthentication.authenticateAdmin(authorization)) {
- logger.error(EELFLoggerDelegate.errorLogger, "Unauthorized: Please check admin username,password and try again", AppMessages.MISSINGDATA, ErrorSeverity.CRITICAL,
- ErrorTypes.AUTHENTICATIONERROR);
- response.status(Status.UNAUTHORIZED);
- return response
- .entity(new JsonResponse(ResultType.FAILURE)
- .setError("Unauthorized: Please check admin username,password and try again").toMap())
- .build();
- }
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "Unable to authenticate", e);
- response.status(Status.UNAUTHORIZED);
- return response.entity(new JsonResponse(ResultType.FAILURE).setError(e.getMessage()).toMap()).build();
- }