private String getTranslatedMessageForExceptionClass(final String className,
                                                         final HttpServletRequest request,
                                                         final ApplicationContext applicationContext) {
        try {
            val msgKey = MessageBundleProperties.DEFAULT_BUNDLE_PREFIX_AUTHN_FAILURE + className;
            return applicationContext.getMessage(msgKey, null, request.getLocale());
        } catch (final Exception e) {
            LOGGER.trace(e.getMessage(), e);
            return StringUtils.EMPTY;
        }
    }
Create response entity for authn failure response.

@param e                  the e
@param request            the http request
@param applicationContext the application context
@return the response entity
support/cas-server-support-rest-core/src/main/java/org/apereo/cas/support/rest/resources/RestResourceUtils.java