Errors are now reported using sendError instead of setStatus.
This change was made to enable the use of error pages defined in web.xml.
This commit is contained in:
parent
7b7fbd3257
commit
68edf9ce48
2 changed files with 4 additions and 20 deletions
|
@ -57,7 +57,7 @@ public class AuthenticatedActionsHandler {
|
||||||
protected boolean abortTokenResponse() {
|
protected boolean abortTokenResponse() {
|
||||||
if (facade.getSecurityContext() == null) {
|
if (facade.getSecurityContext() == null) {
|
||||||
log.debugv("Not logged in, sending back 401: {0}",facade.getRequest().getURI());
|
log.debugv("Not logged in, sending back 401: {0}",facade.getRequest().getURI());
|
||||||
facade.getResponse().setStatus(401);
|
facade.getResponse().sendError(401);
|
||||||
facade.getResponse().end();
|
facade.getResponse().end();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ public class AuthenticatedActionsHandler {
|
||||||
log.debugv("allowedOrigins did not contain origin");
|
log.debugv("allowedOrigins did not contain origin");
|
||||||
|
|
||||||
}
|
}
|
||||||
facade.getResponse().setStatus(403);
|
facade.getResponse().sendError(403);
|
||||||
facade.getResponse().end();
|
facade.getResponse().end();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,23 +174,7 @@ public class OAuthRequestAuthenticator {
|
||||||
final String state = getStateCode();
|
final String state = getStateCode();
|
||||||
final String redirect = getRedirectUri(state);
|
final String redirect = getRedirectUri(state);
|
||||||
if (redirect == null) {
|
if (redirect == null) {
|
||||||
return new AuthChallenge() {
|
return challenge(403);
|
||||||
@Override
|
|
||||||
public boolean challenge(HttpFacade exchange) {
|
|
||||||
exchange.getResponse().setStatus(403);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean errorPage() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getResponseCode() {
|
|
||||||
return 403;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
return new AuthChallenge() {
|
return new AuthChallenge() {
|
||||||
|
|
||||||
|
@ -283,7 +267,7 @@ public class OAuthRequestAuthenticator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean challenge(HttpFacade exchange) {
|
public boolean challenge(HttpFacade exchange) {
|
||||||
exchange.getResponse().setStatus(code);
|
exchange.getResponse().sendError(code);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue