Question

My website is running on .Net and i'm using SDL Tridion 2009. When a user logs in, I can see that the REMOTE_USER variable is correctly stored in the taf:server:variables group in the claim store (using a .net script).

In my cartridge (java) i'm trying to extract this value, but I can see when printing everything in the claim store this value is blank.

my Java code looks like this:

Map serverParameters = (Map)claimStore.get(WebClaims.SERVER_VARIABLES);

for (Object key: serverParameters.keySet()) {
  log.debug("Key : " + key.toString() + " Value : " + serverParameters.get(key));
} 

Update:

My cartridge configuration contains the following inputclaim:

<InputClaims>
   <ClaimDefinition Uri="taf:server:variables" />
</InputClaims>

This unfortunately doens't help, I've also tried taf:server:variables:remoteuser / remote_user / * with no success.

When I inspect the log, i see the key REMOTE_USER but the value is blank.

I was wondering if anyone else has seen this scenario and knows the solution.

Was it helpful?

Solution

It's perfectly valid for REMOTE_USER to be empty, if the request is done without authentication (i.e. anonymous access is allowed).

So that seems the most obvious issue. You should not expect it to always be set, but you can of course enforce an authentication scheme for the relevant URLs on your server so that it is filled correctly in the cases you want your cartridge to handle.

P.S. The input claim section is not relevant in this case, as the server variables are not set by a cartridge but by the HTTP Module. The input and output claims are only used to determine the dependencies between (and thus the order of) cartridges.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top