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

removed call redirect when not authorized
This commit is contained in:
Lucio Lelii 2021-02-22 10:09:11 +01:00
parent 943dc7065b
commit 0ab8e327cf
1 changed files with 4 additions and 5 deletions

View File

@ -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 );
}
}
}*/
}
}