On Wed, Apr 22, 2020 at 5:46 AM Yang Yang <[email protected]> wrote:
> Hi, > > I am looking to use the string in certain HTTP header as a session id, and > name the record of the session. Is there any parameter token with HTTP > header authentication extension I can use? If not, could you help to tell > what I should do to customize the HTTP header authentication extension to > work in this way? > > What I really want to achieve is have a unique id for each session record > file that I can generate by myself. Do you have any other solution? > > The only thing that the header module currently passes through is the header that identifies the user. You could easily add another value to this by modifying the following code: https://github.com/apache/guacamole-client/blob/f2405d936379b62553c25cf13270587e0c9feff1/extensions/guacamole-auth-header/src/main/java/org/apache/guacamole/auth/header/AuthenticationProviderService.java#L65-L86 That is where the header module extracts the header and makes it available. You could tweak that code and have it look for another header of your specification that would be passed through, and make that available as a token. Alternatively, Guacamole also has the ${GUAC_DATE} and ${GUAC_TIME} tokens, so if you need to put together something that uniquely identifies the user (i.e. for recording purposes) you could use a combination of tokens, like: ${GUAC_USERNAME}-${GUAC_DATE}-${GUAC_TIME} -Nick
