ARTEMIS-409 clarify STOMP login failure response
This commit is contained in:
parent
a39f43dfe9
commit
eb785b4194
|
@ -67,8 +67,9 @@ public class StompFrameHandlerV10 extends VersionedStompFrameHandler implements
|
||||||
else {
|
else {
|
||||||
//not valid
|
//not valid
|
||||||
response = new StompFrameV10(Stomp.Responses.ERROR);
|
response = new StompFrameV10(Stomp.Responses.ERROR);
|
||||||
response.addHeader(Stomp.Headers.Error.MESSAGE, "Failed to connect");
|
String responseText = "Security Error occurred: User name [" + login + "] or password is invalid";
|
||||||
response.setBody("The login account is not valid.");
|
response.setBody(responseText);
|
||||||
|
response.addHeader(Stomp.Headers.Error.MESSAGE, responseText);
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,8 +93,9 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
|
||||||
response = createStompFrame(Stomp.Responses.ERROR);
|
response = createStompFrame(Stomp.Responses.ERROR);
|
||||||
response.setNeedsDisconnect(true);
|
response.setNeedsDisconnect(true);
|
||||||
response.addHeader(Stomp.Headers.CONTENT_TYPE, "text/plain");
|
response.addHeader(Stomp.Headers.CONTENT_TYPE, "text/plain");
|
||||||
response.addHeader(Stomp.Headers.Error.MESSAGE, "Failed to connect");
|
String responseText = "Security Error occurred: User name [" + login + "] or password is invalid";
|
||||||
response.setBody("The login account is not valid.");
|
response.setBody(responseText);
|
||||||
|
response.addHeader(Stomp.Headers.Error.MESSAGE, responseText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (ActiveMQStompException e) {
|
catch (ActiveMQStompException e) {
|
||||||
|
|
|
@ -91,7 +91,6 @@ public class ActiveMQJAASSecurityManager implements ActiveMQSecurityManager2 {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (LoginException e) {
|
catch (LoginException e) {
|
||||||
logger.info("Couldn't validate user: " + e.getMessage());
|
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug("Couldn't validate user", e);
|
logger.debug("Couldn't validate user", e);
|
||||||
}
|
}
|
||||||
|
@ -120,7 +119,9 @@ public class ActiveMQJAASSecurityManager implements ActiveMQSecurityManager2 {
|
||||||
localSubject = getAuthenticatedSubject(user, password, certificates);
|
localSubject = getAuthenticatedSubject(user, password, certificates);
|
||||||
}
|
}
|
||||||
catch (LoginException e) {
|
catch (LoginException e) {
|
||||||
logger.debug("Couldn't validate user", e);
|
if (logger.isDebugEnabled()) {
|
||||||
|
logger.debug("Couldn't validate user", e);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue