Take the 2-minute tour ×
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It's 100% free, no registration required.

We are using SDL Tridion 2011 SP1 HR2. We have configured two CD WS ,the deployer and the java website to handle UGC. We have integrated identification of visitors through our external website user id by modifying the provided sample SyncUGCUserWithContact class. While saving the comment through the UGC enabled page, the UGC USER name and email is saved properly but ID gets stored as null. UGC user is synced during website authentication. Here the new user doesn't get saved because the condition claimStore.contains(BasePostClaimProcessor.USER_CLAIM) is returned as false and so doesn't save anything.

final String ugcResponse = webServiceClient.getResponse("/Users?$filter=ExternalId eq '" + externalId + "'");
final List<UGCUser> ugcUsers = parseUsers(ugcResponse);
if (ugcUsers != null && !ugcUsers.isEmpty()) {
    //sync exiting user
}
else
{
    if (claimStore.contains(BasePostClaimProcessor.USER_CLAIM)) {
    //// not entering here
    }
}

Even when I enter a comment through CMS, the Administrator name and email is saved but ID is empty.

UPDATE 12/02/2013 12:26

There are no claim definitions with the uri "taf:claim:contentdelivery:webservice:user"

taf:request:cookies:
platform    web
TAFSessionId    tridion_6296c12a-ae5e-4e2f-9194-788a094390a7
language    en
TAFTrackingId   tridion_3244ee9e-cd27-434a-90ee-5f7dfa461bb5

Though tracking id and sessioid is stored in the cookies.

Taking a look at the logs for visitor WS, I can see the user_claim

2014-02-12 09:42:51,487 DEBUG AllowAnonymousPostClaimProcessor - No external user specified (also not in headers), using tracking id.
2014-02-12 09:42:51,487 DEBUG **ClaimStore - put: uri=taf:claim:contentdelivery:webservice:user, value=tridion_11f495d7-c97a-448f-ad56-4560ad2b385d** 
2014-02-12 09:42:51,487 TRACE ODataInputParser - Parsing following queryString: /Comments 
2014-02-12 09:42:51,487 TRACE BasePostClaimProcessor - User ID: tridion_11f495d7-c97a-448f-ad56-4560ad2b385d, Request URI: /odata.svc/Comments 
2014-02-12 09:42:51,487 DEBUG ClaimStore - put:uri=taf:claim:contentdelivery:webservice:post:allowed, value=false
2014-02-12 09:42:51,487 TRACE AmbientDataServletFilter - There is no tracking cookie in the request! 
2014-02-12 09:42:51,487 TRACE AmbientDataServletFilter - CookieClaim -taf:response:cookie:generation:true 
2014-02-12 09:42:51,487 TRACE AmbientDataServletFilter - CookieClaim has value true, setting tracking cookie! 
2014-02-12 09:42:51,487 TRACE AmbientDataServletFilter - setCookie -> name: TAFTrackingId, persistent: true, id:tridion_11f495d7-c97a-448f-ad56-4560ad2b385d
2014-02-12 09:42:51,487 DEBUG AmbientDataServletFilter - doFilter: contextPath=, sessionId=18753A6FCAFA992FC521E0B18317DF09 
2014-02-12 09:42:51,487 DEBUG WebContext - setCurrentClaimStore: com.tridion.ambientdata.claimstore.WebClaimStore@77aaf64d, thread: http-192.168.1.201-8812-1      
2014-02-12 09:42:51,487 TRACE AmbientDataServletFilter - setCookie -> name: AFSessionId, persistent: false, id:tridion_ce4dd922-9d10-4188-b417-571246c8bda6
2014-02-12 09:42:51,487 TRACE AmbientDataServletFilter - There is no tracking cookie in request, so generated a new one:tridion_75d3c896-fa44-4f95-9cf8-f8c6149f4a1b 
2014-02-12 09:42:51,487 DEBUG ClaimStore - put: uri=taf:session:id, value=tridion_ce4dd922-9d10-4188-b417-571246c8bda6 
2014-02-12 09:42:51,487 DEBUG ClaimStore - put: uri=taf:tracking:id, value=tridion_75d3c896-fa44-4f95-9cf8-f8c6149f4a1b 
2014-02-12 09:42:51,487 DEBUG ClaimStore - put: uri=taf:session:attributes, value={}   
2014-02-12 09:42:51,487 DEBUG ClaimStore - put: uri=taf:request:uri, value=/odata.svc/Comments 
2014-02-12 09:42:51,487 DEBUG ClaimStore - put: uri=taf:request:full_url,value=http://192.168.1.201:8812/odata.svc/Comments 
2014-02-12 09:42:51,487 DEBUG ClaimStore - put: uri=taf:request:headers, value={connection=[Ljava.lang.String;@7910769b,host=[Ljava.lang.String;@27daf835,accept=[Ljava.lang.String;@18dd7404,user-agent=[Ljava.lang.String;@72ebbf5c} 
2014-02-12 09:42:51,487 DEBUG ClaimStore - put: uri=taf:request:parameters, value={PATH_INFO=[Ljava.lang.String;@53606bf5, CONTENT_TYPE=[Ljava.lang.String;@5f4fcc96, $orderby=[Ljava.lang.String;@47fe256b, QUERY_STRING=[Ljava.lang.String;@7000bcbc,$filter=Ljava.lang.String;@5ba5ba75,$expand=Ljava.lang.String;@5d748654,$top=[Ljava.lang.String;@d1f24bb, $skip=[Ljava.lang.String;@77a477b7,CONTENT_LENGTH=[Ljava.lang.String;@40671416} 
2014-02-12 09:42:51,487 DEBUG ClaimStore - put: uri=taf:server:variables, value={REMOTE_USER=null, PATH_TRANSLATED=D:\Websites\website-odata1\odata.svc\Comments,SERVER_PORT=8812, SCRIPT_NAME=, REMOTE_ADDR=192.168.1.201, AUTH_TYPE=null, SERVER_PROTOCOL=HTTP/1.1, REQUEST_METHOD=GET, DOCUMENT_ROOT=D:\Websites\website-odata1\, REMOTE_HOST=192.168.1.201, SERVER_NAME=192.168.1.201, SECURE=false}
2014-02-12 09:42:51,487 DEBUG ClaimStore - put: uri=taf:request:cookies, value={} 
2014-02-12 09:42:51,487 DEBUG AmbientDataServletFilter - Dispatching onSessionStart event 
2014-02-12 09:42:51,487 DEBUG AmbientDataServletFilter - Dispatching onRequestStart event 
2014-02-12 09:42:51,487 TRACE ODataInputParser - Parsing following queryString: /Comments 
2014-02-12 09:42:51,487 TRACE BasePostClaimProcessor - User ID: tridion_11f495d7-c97a-448f-ad56-4560ad2b385d, Request URI: /odata.svc/Comments 
2014-02-12 09:42:51,487 DEBUG ClaimStore - put:uri=taf:claim:contentdelivery:webservice:post:allowed, value=false
share|improve this question
add comment

1 Answer

To troubleshoot the USER_CLAIM in the claimstore you can inspect which claims are set in the claim store. Your code expects this USER_CLAIM but apparently it is not set, or with a different claim URI.

Use one of those pages to list all the claims in your claimstore

share|improve this answer
    
I have run the shared page. Have updated the question –  Rache Feb 12 at 9:25
    
Hmm, is the user claim set by the AllowAnonymousPostClaimProcessor? Could you check the cartridge configuration, is the user claim a claim with session scope? Is the user claim set on every request or only once in a session or on a specific page? –  Jan H Feb 12 at 10:44
    
No, AllowAnonymousPostClaimProcessor is commented out. It was from the beginning. In the catridge configuration, user claim is in request scope as given in default sample xml. User claim is set when I submit a comment, so this is a single page. Here it saves comment with user id null. Everytime I login, I call SyncUGCUserWithContact to sync my user as shown in question and when I try to execute, webServiceClient.getResponse("/Users?$filter=...") Since I don't have one created, I try to set but claimStore.contains(BasePostClaimProcessor.USER_CLAIM) returns null. –  Rache Feb 12 at 10:59
    
I am not that experienced with the sample SyncUGCUserWithContact class, but from what you explain it looks like the claim is only set when you login. Since the claim has only request scope it will not be available in any request after logging in. The AllowAnonymousPostClaimProcessor is logging the 1st line so I think it is enabled somehow ;) –  Jan H Feb 12 at 11:05
    
I have changed the scope for USER_CLAIM to session for ugc catridge in the jsp website and visitor side WS. Still doesn't save id. The AllowAnonymousPostClaimProcessor was enabled on the visitor website catridge and when I commented it out, nothing gets saved. So I enabled it again. In a non-anonymous setting, UGC ID is the tridion_id only, right? Or do I have to separately generate it. –  Rache Feb 12 at 12:42
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.