Skip to content

Commit

Permalink
Authentication should be checked earlier in the server pipeline, close
Browse files Browse the repository at this point in the history
  • Loading branch information
yallie committed Dec 5, 2024
1 parent ff483f3 commit 70aaa33
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CoreRemoting/RemotingSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ private void ProcessRpcMessage(WireMessage request)
{
CurrentSession.Value = this;

if (_server.Config.AuthenticationRequired && !_isAuthenticated)
throw new NetworkException("Session is not authenticated.");

var service = _server.ServiceRegistry.GetService(callMessage.ServiceName);
var serviceInterfaceType =
_server.ServiceRegistry.GetServiceInterfaceType(callMessage.ServiceName);
Expand All @@ -448,9 +451,6 @@ private void ProcessRpcMessage(WireMessage request)
methodName: callMessage.MethodName);

oneWay = method.GetCustomAttribute<OneWayAttribute>() != null;

if (_server.Config.AuthenticationRequired && !_isAuthenticated)
throw new NetworkException("Session is not authenticated.");
}
catch (Exception ex)
{
Expand Down

0 comments on commit 70aaa33

Please sign in to comment.