Skip to content

Commit

Permalink
GUACAMOLE-1881: reverting earlier proposed changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Josna battula committed Jan 16, 2024
1 parent 0e99388 commit ee49938
Showing 1 changed file with 4 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@

package org.apache.guacamole.tunnel;

import org.apache.guacamole.net.auth.AuthenticatedUser;
import org.apache.guacamole.net.auth.Credentials;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import org.apache.guacamole.net.auth.AuthenticatedUser;
import org.apache.guacamole.net.auth.Credentials;

/**
* Map which is automatically populated with the name/value pairs of all
Expand All @@ -37,18 +36,6 @@ public class StandardTokenMap extends HashMap<String, String> {
*/
public static final String USERNAME_TOKEN = "GUAC_USERNAME";

/**
* The name of the token containing the user's userid
* when multiple LDAP's is configured, logged-in username is DOMAIN_NAME/USER_NAME.
*/
public static final String USERNAME_ID_TOKEN = "GUAC_USERNAME_ID";

/**
* The name of the token containing the user's domain
* when multiple LDAP's is configured, logged-in username is DOMAIN_NAME/USER_NAME.
*/
public static final String USERNAME_DOMAIN_TOKEN = "GUAC_USERNAME_DOMAIN";

/**
* The name of the token containing the user's password.
*/
Expand Down Expand Up @@ -110,18 +97,11 @@ public StandardTokenMap(AuthenticatedUser authenticatedUser) {
if (username != null)
put(USERNAME_TOKEN, username);

// Default to the authenticated user's username for the GUAC_USERNAME
// token
// Default to the authenticated user's username for the GUAC_USERNAME
// token
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));
}
// Add password token
String password = credentials.getPassword();
if (password != null)
Expand Down

0 comments on commit ee49938

Please sign in to comment.