KEYCLOAK-9095 Fix NPE in AuthenticatedActionsHandler
This commit is contained in:
parent
859bfc06ad
commit
429863e83b
1 changed files with 3 additions and 4 deletions
|
@ -118,15 +118,14 @@ public class AuthenticatedActionsHandler {
|
||||||
if (securityContext != null && origin != null && !origin.equals(requestOrigin)) {
|
if (securityContext != null && origin != null && !origin.equals(requestOrigin)) {
|
||||||
AccessToken token = securityContext.getToken();
|
AccessToken token = securityContext.getToken();
|
||||||
Set<String> allowedOrigins = token.getAllowedOrigins();
|
Set<String> allowedOrigins = token.getAllowedOrigins();
|
||||||
if (log.isDebugEnabled()) {
|
|
||||||
for (String a : allowedOrigins) log.debug(" " + a);
|
log.debugf("Allowed origins in token: %s", allowedOrigins);
|
||||||
}
|
|
||||||
if (allowedOrigins == null || (!allowedOrigins.contains("*") && !allowedOrigins.contains(origin))) {
|
if (allowedOrigins == null || (!allowedOrigins.contains("*") && !allowedOrigins.contains(origin))) {
|
||||||
if (allowedOrigins == null) {
|
if (allowedOrigins == null) {
|
||||||
log.debugv("allowedOrigins was null in token");
|
log.debugv("allowedOrigins was null in token");
|
||||||
} else {
|
} else {
|
||||||
log.debugv("allowedOrigins did not contain origin");
|
log.debugv("allowedOrigins did not contain origin");
|
||||||
|
|
||||||
}
|
}
|
||||||
facade.getResponse().sendError(403);
|
facade.getResponse().sendError(403);
|
||||||
facade.getResponse().end();
|
facade.getResponse().end();
|
||||||
|
|
Loading…
Reference in a new issue