necouchman commented on code in PR #989: URL: https://github.com/apache/guacamole-client/pull/989#discussion_r1620962760
########## extensions/guacamole-auth-sso/modules/guacamole-auth-sso-saml/src/main/java/org/apache/guacamole/auth/saml/user/SAMLAuthenticatedUser.java: ########## @@ -104,6 +104,23 @@ private Set<String> getGroups(AssertedIdentity identity) } + private String getUser(AssertedIdentity identity) + throws GuacamoleException { + + String samlUserAttribute = confService.getUserAttribute(); + List<String> samlUser = null; + + if (samlUserAttribute == null || samlUserAttribute.isEmpty()) + return identity.getUsername(); + + samlUser = identity.getAttributes().get(samlUserAttribute); + if (samlUser == null || samlUser.isEmpty()) + return identity.getUsername(); + + return samlUser.get(0); + + } + Review Comment: Ah, okay, I see - that makes sense. I would think that 1) we'd stick with `null` rather than empty (`""`) for that, but that we'd still want to update `AssertedIdentity` to capture the username from the specified attribute, falling back to `NameId` if the username is not specified. -- 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