diff --git a/xrootd4j/src/main/java/org/dcache/xrootd/core/XrootdAuthorizationHandler.java b/xrootd4j/src/main/java/org/dcache/xrootd/core/XrootdAuthorizationHandler.java index 9e78c00c..f1814470 100644 --- a/xrootd4j/src/main/java/org/dcache/xrootd/core/XrootdAuthorizationHandler.java +++ b/xrootd4j/src/main/java/org/dcache/xrootd/core/XrootdAuthorizationHandler.java @@ -315,17 +315,14 @@ private String authorize(ChannelHandlerContext ctx, throws XrootdException { try { - Channel channel = ctx.channel(); - InetSocketAddress localAddress = - (InetSocketAddress) channel.localAddress(); - InetSocketAddress remoteAddress = - (InetSocketAddress) channel.remoteAddress(); + InetSocketAddress destinationAddress = getDestinationAddress(); + InetSocketAddress sourceAddress = getSourceAddress(); AuthorizationHandler handler = _authorizationFactory.createHandler(); return handler.authorize(request.getSubject(), - localAddress, - remoteAddress, + destinationAddress, + sourceAddress, path, OpaqueStringParser.getOpaqueMap(opaque), request.getRequestId(),