scpcom commented on code in PR #989:
URL: https://github.com/apache/guacamole-client/pull/989#discussion_r1625125262
##########
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:
I did not get the configuration service to work in AssertedIdentity.
This is what I added:
```
import com.google.inject.Inject;
import org.apache.guacamole.auth.saml.conf.ConfigurationService;
public class AssertedIdentity {
/**
* Service for retrieving SAML configuration information.
*/
@Inject
private ConfigurationService confService;
// .....
}
```
In the line that calls "confService.getUserAttribute();" I get "Unexpected
error in REST endpoint." followed by "java.lang.NullPointerException: null"
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]