diff options
author | Udo Walter | 2020-05-13 14:04:52 +0200 |
---|---|---|
committer | Udo Walter | 2020-05-13 14:04:52 +0200 |
commit | e5a3a1d737e88c89a4ba3fbc8d277745093139b1 (patch) | |
tree | 9fac401c4a848eb3a38429f17e6050eaa506dd2e /src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java | |
parent | Fix connecting to a new client after exiting a client. Add logo, favicon and ... (diff) | |
download | bwlp-guacamole-ext-e5a3a1d737e88c89a4ba3fbc8d277745093139b1.tar.gz bwlp-guacamole-ext-e5a3a1d737e88c89a4ba3fbc8d277745093139b1.tar.xz bwlp-guacamole-ext-e5a3a1d737e88c89a4ba3fbc8d277745093139b1.zip |
Add some debug logs. Rename the 'virtual' locations to groups.
Diffstat (limited to 'src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java')
-rw-r--r-- | src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java b/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java index 0fc7bc8..c59c477 100644 --- a/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java +++ b/src/main/java/de/bwlehrpool/bwlp_guac/BwlpAuthenticationProvider.java @@ -66,26 +66,26 @@ public class BwlpAuthenticationProvider implements AuthenticationProvider { if (user != null && user.hasValidConnection()) return user; - int locationid = requestLocation(credentials); + int groupid = requestGroup(credentials); LOGGER.warn("Doing the REdecoration"); - user = new BwlpUserContext(authenticatedUser, context, locationid); + user = new BwlpUserContext(authenticatedUser, context, groupid); oldMappings.put(username, user); return user; } - private int requestLocation(Credentials credentials) throws GuacamoleException { - // Request the user to select a location + private int requestGroup(Credentials credentials) throws GuacamoleException { + // Request the user to select a group ConnectionManager.updateList(); HttpServletRequest request = credentials.getRequest(); - String locationJson = request.getParameter("location"); + String groupJson = request.getParameter("group"); - if (locationJson == null) { + if (groupJson == null) { throw new GuacamoleInsufficientCredentialsException( "Select Location", new CredentialsInfo( - Collections.<Field>singletonList(new LocationField()) + Collections.<Field>singletonList(new GroupField()) )); } @@ -98,14 +98,14 @@ public class BwlpAuthenticationProvider implements AuthenticationProvider { String password = ""; String correctPassword = null; try { - JsonNode location = mapper.readTree(locationJson); - selectedId = Integer.parseInt(location.get("id").asText()); + JsonNode group = mapper.readTree(groupJson); + selectedId = Integer.parseInt(group.get("id").asText()); if (selectedId != 0) { - password = location.get("password").asText(); - correctPassword = ConnectionManager.getLocationPool().get(selectedId).password; + password = group.get("password").asText(); + correctPassword = ConnectionManager.getGroupPool().get(selectedId).password; } } catch (Exception e) { - LOGGER.info("Error reading location", e); + LOGGER.info("Error reading group", e); tryAgain = true; } @@ -117,7 +117,7 @@ public class BwlpAuthenticationProvider implements AuthenticationProvider { if (tryAgain) { throw new GuacamoleCredentialsException( message, new CredentialsInfo( - Collections.<Field>singletonList(new LocationField()) + Collections.<Field>singletonList(new GroupField()) )); } |