Update 'src/main/java/org/gcube/smartgears/handlers/application/request/RequestValidator.java'

removed call redirect when not authorized
master r5.0.0
Lucio Lelii 3 years ago
parent 943dc7065b
commit 0ab8e327cf

@ -98,10 +98,9 @@ public class RequestValidator extends RequestHandler {
if (token == null && scope==null){
log.warn("rejecting call to {}, authorization required",context.name(),token);
if (call.context().container().configuration().authenticationEnpoint()==null){
log.warn("rejecting call to {}, authorization required",context.name(),token);
RequestError.request_not_authorized_error.fire(context.name()+": authorization required");
}else {
//if (call.context().container().configuration().authenticationEnpoint()==null){
RequestError.request_not_authorized_error.fire(context.name()+": authorization required");
/*}else {
log.info("authorization enpoint found on configuration, redirecting the call");
String recallLocation = String.format("http://%s:%d%s", call.context().container().configuration().hostname(), call.context().container().configuration().port(), call.uri());
//call.response().setHeader("Allowed-Contexts", call.context().container().configuration().allowedContexts().toString());
@ -110,7 +109,7 @@ public class RequestValidator extends RequestHandler {
} catch (IOException e) {
log.error("errror redirecting call",e );
}
}
}*/
}
}

Loading…
Cancel
Save