mike-jumper commented on a change in pull request #383: GUACAMOLE-715: Change
how null JDBC users are handled
URL: https://github.com/apache/guacamole-client/pull/383#discussion_r268450606
##########
File path:
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/UserService.java
##########
@@ -411,8 +411,13 @@ public ModeledUser retrieveUser(AuthenticationProvider
authenticationProvider,
// Retrieve corresponding user model, if such a user exists
UserModel userModel = userMapper.selectOne(username);
- if (userModel == null)
- return null;
+
+ // If no user exists, create a temporary one to map
+ // the authenticated user.
+ if (userModel == null) {
+ userModel = new UserModel();
Review comment:
Unfortunately, this will break handling of the `mysql-user-required`,
`postgresql-user-required`, etc. properties, which rely on this function
returning `null` if no user exists:
http://guacamole.apache.org/doc/gug/jdbc-auth.html#jdbc-auth-restrict
See:
https://github.com/apache/guacamole-client/blob/d1e928bea79ca81c827e9b6adedabc98eefdf701/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/JDBCAuthenticationProviderService.java#L84-L140
This function's documented return behavior will also need to be updated if
this change (or something similar to it) are implemented. It is currently
documented as returning `null` if no such user exists.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services