>> You can view the guacamole-ext documentation here:
>> https://guacamole.apache.org/doc/guacamole-ext/
>> The user's organization is an Attribute, so it'd be something like:
>> GuacamoleSession session = entry.getValue(); tokens.put(entry.getKey(),
>> session.getUserContext(session.getAuthenticatedUser().getAuthenticationProvider().getIdentifier()).self().getAttributes(User.Attribute.ORGANIZATION));
>>That's just a quick stab at it based on the class documentation, and without
>>factoring in where you're running your getAllTokens() method, what
>>permissions it is running with, and that there may be an >>easier way to get
>>the information you're wanting.
>>That said, I'm not sure why you're wanting to do what the code looks like
>>you're doing - it looks to me like you'd end up with a set of Guacamole
>>parameter tokens where the name is the session identifier
>>(entry.getKey()) and the value is the organization the user belongs to. Since
>>session identifiers are going to be random, this wouldn't be a very useful
>>token for any configuration purposes - it'll be different for >>every single
>>user, and different every time a user logs in..
>>Maybe you could describe, at a higher level, what you're trying to accomplish?
How can I get attributes related to DataBase Authentication Provider, not
Tacacs Authentication Provider? Because with this last, there is no attributes.
@Override
public Map<String, String> getAllTokens(String organization) throws
GuacamoleException {
final Map<String, String> tokens = new HashMap<String,
String>();
for (Map.Entry<String, GuacamoleSession> entry :
this.sessionMap.entrySet()) {
GuacamoleSession session = entry.getValue();
Map<String, String> attr =
session.getUserContext(session.getAuthenticatedUser()
.getAuthenticationProvider().getIdentifier()).self()
.getAttributes();
if
(attr.get(User.Attribute.ORGANIZATION).equals(organization)
&&
!attr.get(User.Attribute.FULL_NAME).equals(USER_KILL_SESSION)) {
tokens.put(entry.getValue().getAuthenticatedUser()
.getCredentials().getUsername(), entry.getKey());
}
}
return tokens;
}
And is throwing a null exception in this line:
if (attr.get(User.Attribute.ORGANIZATION).equals(organization) &&
!attr.get(User.Attribute.FULL_NAME).equals(USER_KILL_SESSION)) {
-Gabriel
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]