Github user pivotal-amurmann commented on a diff in the pull request: https://github.com/apache/geode/pull/719#discussion_r135153564 --- Diff: geode-protobuf/src/main/java/org/apache/geode/protocol/protobuf/ProtobufSimpleAuthenticator.java --- @@ -41,20 +43,29 @@ public void receiveMessage(InputStream inputStream, OutputStream outputStream, properties.setProperty(ResourceConstants.USER_NAME, authenticationRequest.getUsername()); properties.setProperty(ResourceConstants.PASSWORD, authenticationRequest.getPassword()); + authorizer = null; // authenticating a new user clears current authorizer try { Object principal = securityManager.authenticate(properties); - authenticated = principal != null; + if (principal != null) { + authorizer = new ProtobufSimpleAuthorizer(principal, securityManager); + } } catch (AuthenticationFailedException e) { - authenticated = false; + authorizer = null; } - AuthenticationAPI.SimpleAuthenticationResponse.newBuilder().setAuthenticated(authenticated) + AuthenticationAPI.SimpleAuthenticationResponse.newBuilder().setAuthenticated(isAuthenticated()) .build().writeDelimitedTo(outputStream); } @Override public boolean isAuthenticated() { - return authenticated; + // note: an authorizer is only created if the user has been authenticated + return authorizer != null; --- End diff -- this would be nicer as well if `Optional`
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---