Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
GUAC-586: Use data source when connecting to connections or groups. R…
Browse files Browse the repository at this point in the history
…emove deprecated getUserContext() from GuacamoleSession and related classes. Use identifiers which embed the data source for client URLs.
  • Loading branch information
mike-jumper committed Sep 3, 2015
1 parent d2924a5 commit b3614ae
Show file tree
Hide file tree
Showing 18 changed files with 609 additions and 185 deletions.
Expand Up @@ -115,40 +115,6 @@ public void setAuthenticatedUser(AuthenticatedUser authenticatedUser) {
this.authenticatedUser = authenticatedUser; this.authenticatedUser = authenticatedUser;
} }


/**
* Returns the UserContext associated with this session.
*
* @return The UserContext associated with this session.
*/
public UserContext getUserContext() {

// Warn of deprecation
logger.debug(
"\n****************************************************************"
+ "\n"
+ "\n !!!! PLEASE DO NOT USE getUserContext() !!!!"
+ "\n"
+ "\n getUserContext() has been replaced by getUserContexts(), which"
+ "\n properly handles multiple authentication providers. All use of"
+ "\n the old getUserContext() must be removed before GUAC-586 can"
+ "\n be considered complete."
+ "\n"
+ "\n****************************************************************"
);

// Return the UserContext associated with the AuthenticationProvider
// that authenticated the current user.
String authProviderIdentifier = authenticatedUser.getAuthenticationProvider().getIdentifier();
for (UserContext userContext : userContexts) {
if (userContext.getAuthenticationProvider().getIdentifier().equals(authProviderIdentifier))
return userContext;
}

// If not found, return null
return null;

}

/** /**
* Returns a list of all UserContexts associated with this session. Each * Returns a list of all UserContexts associated with this session. Each
* AuthenticationProvider currently loaded by Guacamole may provide its own * AuthenticationProvider currently loaded by Guacamole may provide its own
Expand Down
Expand Up @@ -31,7 +31,7 @@
* *
* @author Michael Jumper * @author Michael Jumper
*/ */
public class HTTPTunnelRequest implements TunnelRequest { public class HTTPTunnelRequest extends TunnelRequest {


/** /**
* The wrapped HttpServletRequest. * The wrapped HttpServletRequest.
Expand Down

0 comments on commit b3614ae

Please sign in to comment.