mike-jumper commented on code in PR #931:
URL: https://github.com/apache/guacamole-client/pull/931#discussion_r1394980110


##########
guacamole/src/main/java/org/apache/guacamole/tunnel/StandardTokenMap.java:
##########
@@ -102,6 +115,13 @@ public StandardTokenMap(AuthenticatedUser 
authenticatedUser) {
         else
             put(USERNAME_TOKEN, authenticatedUser.getIdentifier());
 
+        if (get(USERNAME_TOKEN).contains("\\")) {
+            put(USERNAME_DOMAIN_TOKEN, get(USERNAME_TOKEN).split("\\\\")[0]);
+            put(USERNAME_ID_TOKEN, get(USERNAME_TOKEN).split("\\\\")[1]);
+        } else {
+            put(USERNAME_DOMAIN_TOKEN, "");
+            put(USERNAME_ID_TOKEN, get(USERNAME_TOKEN));
+        }

Review Comment:
   > `authenticatedUser.getIdentifier()` only gives us which authentication 
mechanism i have used for my guacamole instance.
   
   What do you mean? The `AuthenticatedUser` is the object defining the user's 
authenticated identity, with `getIdentifier()` returning the unique identifier 
for that identity. In the case of LDAP, that is the username. This is exactly 
the value that is returned as the username to be exposed in the UI:
   
   
https://github.com/apache/guacamole-client/blob/284d1b24f37f06d380312e149d24d96497dd9af4/guacamole/src/main/java/org/apache/guacamole/rest/auth/TokenRESTService.java#L188C1-L194
   
   Providing the identifier as a token would allow the relevant username to be 
included in the configuration independently of what the user enters in a login 
form.



-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to