5

Right now we have a fresh install of Web 8.5 on the DXA 1.7 webapp. The webapp is pretty much OOTB right now except for the UGC work that we are doing (explained below). We are currently attempting to implement UGC within the DXA 1.7 webapp. We have the ratings working along with the ability to post comments however when a user tries to save or remove their comment nothing happens. This seems to be due to the fact that the claims are not forwarding properly to the ugc service. Our Webapp has the following logs when we try to submit a save comment request:

2017-10-19 14:31:31,435 DEBUG AbstractAmbientDataServletFilter - Creating new ClaimStore for session: 591D5DB8A423A99B9C8F685DBBBF3306
2017-10-19 14:31:31,435 DEBUG DefaultClaimStore - put: uri=taf:response:cookie:generation, value=true
2017-10-19 14:31:31,435 TRACE AbstractAmbientDataServletFilter - The cookie claim store was inserted!taf:response:cookie:generation:true
2017-10-19 14:31:31,435 DEBUG WebContext - setCurrentClaimStore: com.tridion.ambientdata.claimstore.JavaClaimStore@a53be80, thread: http-nio2-8085-exec-6
2017-10-19 14:31:31,435 DEBUG DefaultClaimStore - put: uri=taf:request:uri, value=/community.svc/Comments(Id=4)
2017-10-19 14:31:31,435 DEBUG DefaultClaimStore - put: uri=taf:request:full_url, value=http://localhost:8085/community.svc/Comments(Id=4)
2017-10-19 14:31:31,435 DEBUG DefaultClaimStore - put: uri=taf:request:headers, value={authorization=[Ljava.lang.String;@49451ba, content-length=[Ljava.lang.String;@abd5f0, cookie=[Ljava.lang.String;@45a95b81, host=[Ljava.lang.String;@52194a0a, content-type=[Ljava.lang.String;@74a6d872, connection=[Ljava.lang.String;@2afc9743, cache-control=[Ljava.lang.String;@2586a4ce, pragma=[Ljava.lang.String;@3d57e36e, accept=[Ljava.lang.String;@7ff0c9fe, user-agent=[Ljava.lang.String;@31f81fcc}
2017-10-19 14:31:31,435 DEBUG DefaultClaimStore - put: uri=taf:request:parameters, value={CONTENT_LENGTH=[Ljava.lang.String;@21c87de9, QUERY_STRING=[Ljava.lang.String;@2306a62d, CONTENT_TYPE=[Ljava.lang.String;@5ac0348a, PATH_INFO=[Ljava.lang.String;@2bb75661}
2017-10-19 14:31:31,436 DEBUG DefaultClaimStore - put: uri=taf:server:variables, value={SERVER_PORT=8085, REMOTE_HOST=127.0.0.1, SERVER_PROTOCOL=HTTP/1.1, DOCUMENT_ROOT=C:\Windows\Temp\tomcat-docbase.3887611230013376733.8085\, REQUEST_METHOD=PUT, SCRIPT_NAME=/community.svc/Comments(Id=4), REMOTE_ADDR=127.0.0.1, SECURE=false, PATH_TRANSLATED=null, SERVER_NAME=localhost, AUTH_TYPE=null, REMOTE_USER=null}
2017-10-19 14:31:31,436 DEBUG DefaultClaimStore - put: uri=taf:request:cookies, value={}
2017-10-19 14:31:31,436 TRACE ClaimStoreUtil - Getting IP address from the ClaimStore.
2017-10-19 14:31:31,436 TRACE ClaimStoreUtil - Found an IP: 127.0.0.1
2017-10-19 14:31:31,437 INFO  AbstractAmbientDataServletFilter - Requested by IP: /127.0.0.1
2017-10-19 14:31:31,437 TRACE AbstractAmbientDataServletFilter - setCookie -> name: TAFSessionId, persistent: false, id:tridion_969b1fd8-6b12-4704-941e-a90f280364de
2017-10-19 14:31:31,437 TRACE AbstractAmbientDataServletFilter - There is no tracking cookie in request, so generated a new one:tridion_a59a89f4-a8f5-4c88-9623-1a287cbcd65d
2017-10-19 14:31:31,437 DEBUG DefaultClaimStore - put: uri=taf:session:id, value=tridion_969b1fd8-6b12-4704-941e-a90f280364de
2017-10-19 14:31:31,437 DEBUG DefaultClaimStore - put: uri=taf:tracking:id, value=tridion_a59a89f4-a8f5-4c88-9623-1a287cbcd65d
2017-10-19 14:31:31,437 DEBUG DefaultClaimStore - put: uri=taf:session:attributes, value={}
2017-10-19 14:31:31,437 DEBUG AbstractAmbientDataServletFilter - Validating request.
2017-10-19 14:31:31,437 DEBUG DefaultClaimStore - put: uri=taf:claim:contentdelivery:webservice:client:client_id, value=cduser
2017-10-19 14:31:31,437 DEBUG DefaultClaimStore - put: uri=taf:claim:contentdelivery:webservice:client:Role, value=cd
2017-10-19 14:31:31,437 DEBUG DefaultClaimStore - put: uri=taf:claim:contentdelivery:webservice:client:FirstName, value=CD
2017-10-19 14:31:31,437 DEBUG DefaultClaimStore - put: uri=taf:claim:contentdelivery:webservice:client:AllowedCookieForwarding, value=true
2017-10-19 14:31:31,437 DEBUG DefaultClaimStore - put: uri=taf:claim:contentdelivery:webservice:client:LastName, value=User
2017-10-19 14:31:31,438 DEBUG DefaultClaimStore - put: uri=taf:claim:contentdelivery:webservice:client:expiresOn, value=1508423791428
2017-10-19 14:31:31,438 DEBUG DefaultClaimStore - put: uri=taf:claim:contentdelivery:webservice:client:digest, value=xuNntLlVjYFl6gT7a3zSYHzhSqUf-IJZ6vty1caA9KM=
2017-10-19 14:31:31,438 DEBUG AbstractAmbientDataServletFilter - Request is validated.
2017-10-19 14:31:31,438 DEBUG AbstractAmbientDataServletFilter - Processing cookie claims.
2017-10-19 14:31:31,438 DEBUG AbstractAmbientDataServletFilter - Cookie forwarding is enabled: true
2017-10-19 14:31:31,438 DEBUG AbstractAmbientDataServletFilter - Cookie forwarding for account is set to: true
2017-10-19 14:31:31,438 DEBUG AbstractAmbientDataServletFilter - Cookie forwarding for current request is allowed: true
2017-10-19 14:31:31,438 DEBUG AbstractAmbientDataServletFilter - Deserializing claim cookies.
2017-10-19 14:31:31,438 DEBUG ClaimCookieDeserializer - The list of ClaimsCookies sent to be deserialized is empty!
2017-10-19 14:31:31,438 DEBUG AmbientDataServletFilter - Dispatching onSessionStart event
2017-10-19 14:31:31,438 DEBUG ServerEngine - Running session start Claim Processor class com.sdl.web.ugc.odata.claimprocessor.PostAllowedByOwnerClaimProcessor
2017-10-19 14:31:31,438 DEBUG ServerEngine - Running session start Claim Processor class com.sdl.web.ugc.odata.claimprocessor.AllowAnonymousPostClaimProcessor
2017-10-19 14:31:31,438 DEBUG AmbientDataServletFilter - Dispatching onRequestStart event
2017-10-19 14:31:31,438 DEBUG ServerEngine - Running request start claim processor class com.sdl.web.ugc.odata.claimprocessor.AllowAnonymousPostClaimProcessor
2017-10-19 14:31:31,438 DEBUG AllowAnonymousPostClaimProcessor - No external user specified, using tracking id.
2017-10-19 14:31:31,438 DEBUG AllowAnonymousPostClaimProcessor - No external user specified, using tracking id.
2017-10-19 14:31:31,438 DEBUG DefaultClaimStore - put: uri=taf:claim:contentdelivery:webservice:user, value=tridion_a59a89f4-a8f5-4c88-9623-1a287cbcd65d
2017-10-19 14:31:31,438 DEBUG ServerEngine - Running request start claim processor class com.sdl.web.ugc.odata.claimprocessor.PostAllowedByOwnerClaimProcessor
2017-10-19 14:31:31,439 TRACE ODataInputParser - Parsing following queryString: /Comments(Id=4)
2017-10-19 14:31:31,439 TRACE ODataInputParser - Parsing following queryString: /Comments(Id=4)
2017-10-19 14:31:31,439 TRACE BasePostClaimProcessor - User ID: tridion_a59a89f4-a8f5-4c88-9623-1a287cbcd65d, Request URI: /community.svc/Comments(Id=4)
2017-10-19 14:31:31,439 TRACE BasePostClaimProcessor - User ID: tridion_a59a89f4-a8f5-4c88-9623-1a287cbcd65d, Request URI: /community.svc/Comments(Id=4)
2017-10-19 14:31:31,439 TRACE PostAllowedByOwnerClaimProcessor - This is a PUT or DELETE, checking if this is the owner
2017-10-19 14:31:31,439 TRACE PostAllowedByOwnerClaimProcessor - This is a PUT or DELETE, checking if this is the owner
2017-10-19 14:31:31,439 TRACE KernelFactory - getKernel
2017-10-19 14:31:31,439 DEBUG DAOPropertiesLoaderImpl - Default storage provider has caching set to: false
2017-10-19 14:31:31,439 DEBUG DAOPropertiesLoaderImpl - Loaded following dao Properties[publication=0, typeMapping=Comment, storageId=defaultdb, cached=false] for publication/typeMapping/itemExtension: 0 / Comment / null
2017-10-19 14:31:31,439 DEBUG StorageManagerImpl - Loading a non cached DAO for publicationId/typeMapping/itemExtension: 0 / Comment / null
2017-10-19 14:31:31,439 DEBUG StorageManagerImpl - Wrapping DAO's, currently 0 wrappers installed
2017-10-19 14:31:31,439 DEBUG JPACommentDAO - Searching for comment with id 4 in storage.
2017-10-19 14:31:31,441 TRACE ParentLastClassLoader - Loading class: com.tridion.storage.ugc using ServiceLoader
2017-10-19 14:31:31,441 TRACE ParentLastClassLoader - Could not find class: com.tridion.storage.ugc in ServiceLoader
2017-10-19 14:31:31,442 TRACE ParentLastClassLoader - Loading class: c using ServiceLoader
2017-10-19 14:31:31,442 TRACE ParentLastClassLoader - Could not find class: c in ServiceLoader
2017-10-19 14:31:31,444 TRACE RetryPoolingDataSource - Trying to get connection. Attempt:0
2017-10-19 14:31:31,445 TRACE ParentLastClassLoader - Loading class: org.hibernate.type.descriptor.sql.BigIntTypeDescriptor$1 using ServiceLoader
2017-10-19 14:31:31,447 TRACE ParentLastClassLoader - Loading class: org.hibernate.type.descriptor.sql.BigIntTypeDescriptor$2 using ServiceLoader
2017-10-19 14:31:31,447 TRACE ParentLastClassLoader - Loading class: org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$2 using ServiceLoader
2017-10-19 14:31:31,448 TRACE ParentLastClassLoader - Loading class: org.hibernate.event.spi.LoadEventListener$LoadType using ServiceLoader
2017-10-19 14:31:31,449 TRACE ParentLastClassLoader - Loading class: org.hibernate.event.spi.LoadEvent using ServiceLoader
2017-10-19 14:31:31,449 TRACE ParentLastClassLoader - Loading class: org.hibernate.event.spi.LoadEvent$1 using ServiceLoader
2017-10-19 14:31:31,451 TRACE ParentLastClassLoader - Loading class: org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$1 using ServiceLoader
2017-10-19 14:31:31,452 TRACE ParentLastClassLoader - Loading class: org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader$SqlStatementWrapper using ServiceLoader
2017-10-19 14:31:31,452 TRACE ParentLastClassLoader - Loading class: org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader$1 using ServiceLoader
2017-10-19 14:31:31,453 TRACE ParentLastClassLoader - Loading class: org.hibernate.loader.plan.exec.process.internal.ResultSetProcessingContextImpl using ServiceLoader
2017-10-19 14:31:31,453 TRACE ParentLastClassLoader - Loading class: org.hibernate.loader.plan.exec.process.spi.ResultSetProcessingContext$EntityReferenceProcessingState using ServiceLoader
2017-10-19 14:31:31,454 TRACE ParentLastClassLoader - Loading class: org.hibernate.loader.plan.exec.process.internal.ResultSetProcessingContextImpl$1 using ServiceLoader
2017-10-19 14:31:31,455 TRACE ParentLastClassLoader - Loading class: org.hibernate.loader.plan.exec.process.internal.HydratedEntityRegistration using ServiceLoader
2017-10-19 14:31:31,455 TRACE ParentLastClassLoader - Loading class: org.hibernate.engine.loading.internal.LoadContexts using ServiceLoader
2017-10-19 14:31:31,456 TRACE ParentLastClassLoader - Loading class: org.hibernate.internal.CoreMessageLogger_$logger_en_US using ServiceLoader
2017-10-19 14:31:31,456 TRACE ParentLastClassLoader - Could not find class: org.hibernate.internal.CoreMessageLogger_$logger_en_US in ServiceLoader
2017-10-19 14:31:31,457 TRACE ParentLastClassLoader - Loading class: org.hibernate.internal.CoreMessageLogger_$logger_en using ServiceLoader
2017-10-19 14:31:31,457 TRACE ParentLastClassLoader - Could not find class: org.hibernate.internal.CoreMessageLogger_$logger_en in ServiceLoader
2017-10-19 14:31:31,458 TRACE ParentLastClassLoader - Loading class: org.hibernate.engine.spi.CollectionKey using ServiceLoader
2017-10-19 14:31:31,458 TRACE ParentLastClassLoader - Loading class: org.hibernate.collection.internal.PersistentBag using ServiceLoader
2017-10-19 14:31:31,459 TRACE ParentLastClassLoader - Loading class: org.hibernate.collection.internal.AbstractPersistentCollection using ServiceLoader
2017-10-19 14:31:31,460 TRACE ParentLastClassLoader - Loading class: org.hibernate.collection.internal.AbstractPersistentCollection$LazyInitializationWork using ServiceLoader
2017-10-19 14:31:31,461 TRACE ParentLastClassLoader - Loading class: org.hibernate.LazyInitializationException using ServiceLoader
2017-10-19 14:31:31,461 TRACE ParentLastClassLoader - Loading class: org.hibernate.collection.internal.AbstractPersistentCollection$DelayedOperation using ServiceLoader
2017-10-19 14:31:31,462 TRACE ParentLastClassLoader - Loading class: org.hibernate.internal.CoreMessageLogger_$logger_en_US using ServiceLoader
2017-10-19 14:31:31,462 TRACE ParentLastClassLoader - Could not find class: org.hibernate.internal.CoreMessageLogger_$logger_en_US in ServiceLoader
2017-10-19 14:31:31,462 TRACE ParentLastClassLoader - Loading class: org.hibernate.internal.CoreMessageLogger_$logger_en using ServiceLoader
2017-10-19 14:31:31,462 TRACE ParentLastClassLoader - Could not find class: org.hibernate.internal.CoreMessageLogger_$logger_en in ServiceLoader
2017-10-19 14:31:31,463 TRACE ParentLastClassLoader - Loading class: org.hibernate.engine.spi.CollectionEntry using ServiceLoader
2017-10-19 14:31:31,464 TRACE ParentLastClassLoader - Loading class: org.hibernate.internal.CoreMessageLogger_$logger_en_US using ServiceLoader
2017-10-19 14:31:31,465 TRACE ParentLastClassLoader - Could not find class: org.hibernate.internal.CoreMessageLogger_$logger_en_US in ServiceLoader
2017-10-19 14:31:31,465 TRACE ParentLastClassLoader - Loading class: org.hibernate.internal.CoreMessageLogger_$logger_en using ServiceLoader
2017-10-19 14:31:31,465 TRACE ParentLastClassLoader - Could not find class: org.hibernate.internal.CoreMessageLogger_$logger_en in ServiceLoader
2017-10-19 14:31:31,466 TRACE ParentLastClassLoader - Loading class: org.hibernate.internal.util.collections.IdentityMap$IdentityKey using ServiceLoader
2017-10-19 14:31:31,467 TRACE JPABaseDAO - [ActionTimer] Query List Result time: 27376600 nanoseconds (27.3766 milliseconds)
2017-10-19 14:31:31,467 TRACE ParentLastClassLoader - Loading class: org.hibernate.internal.util.collections.IdentityMap$IdentityMapEntry using ServiceLoader
2017-10-19 14:31:31,468 TRACE PostAllowedByOwnerClaimProcessor - This is not the owner of the comment, setting post_allowed_claim to false
2017-10-19 14:31:31,468 TRACE PostAllowedByOwnerClaimProcessor - This is not the owner of the comment, setting post_allowed_claim to false
2017-10-19 14:31:31,468 DEBUG DefaultClaimStore - put: uri=taf:claim:contentdelivery:webservice:post:allowed, value=false

Of note here is the fact that "The list of ClaimsCookies sent to be deserialized is empty!". Our cd_ugc_conf.xml file appears to be setup correctly with the following config:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration Version="8.5"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:noNamespaceSchemaLocation="schemas/cd_ugc_conf.xsd">
    <Comment>
        <ScoreMinimumThreshold>-10</ScoreMinimumThreshold>
        <Whitelist>
           ...
        </Whitelist>
    </Comment>
    <ODataEndpoint URL="http://localhost:8085/community.svc">
    </ODataEndpoint>
    <ForwardedClaims CookieName="TAFContext">
        <Claim Uri="taf:tracking:id"/>
        <Claim Uri="taf:claim:contentdelivery:webservice:user"/>
        <Claim Uri="taf:claim:contentdelivery:webservice:post:allowed"/>
    </ForwardedClaims>
</Configuration>

For some reason, the proper claims are not being sent with the request. Any ideas as to why they are not picked up and sent correctly?

Edit: The main issue here is that the UGC service ends up not knowing which user has requested the comment update. This is due to the fact that the UGC claims:

taf:claim:contentdelivery:webservice:user
taf:claim:contentdelivery:webservice:post:allowed
taf:tracking:id

Never make it to the service. This seems to be because it does not recognize that the tracking cookie exists and it makes a new one for each request:

TRACE c.t.a.w.AbstractAmbientDataServletFilter - There is no tracking cookie in the request!

The UGC service then disallows the request and does not update the comment, since the request does not appear to be coming from the same user.

0

It looks like the claim URIs you have set to forward in your config don't match the ones you have in your log, i.e. you've configured to allow

taf:claim:contentdelivery:webservice:user
taf:claim:contentdelivery:webservice:post:allowed
taf:tracking:id

but you're not setting those claims. The log shows you're setting:

taf:claim:contentdelivery:webservice:client:FirstName
taf:claim:contentdelivery:webservice:client:LastName
taf:claim:contentdelivery:webservice:client:AllowedCookieForwarding
taf:claim:contentdelivery:webservice:client:Role
taf:claim:contentdelivery:webservice:client:expiresOn
taf:claim:contentdelivery:webservice:client:digest
taf:claim:contentdelivery:webservice:client:client_id

Try adding the claims that you're doing a put on into the forwarding config.

  • I've added the FirstName...client_id claims into my forwarding config but that does not seem to have fixed the core issue. According to the documentation the UGC functionality only uses the user, post:allowed, and tracking:id claims. I've updated the question with this information and what I believe to be the root of the problem. – Nicholas Wetmore Oct 19 '17 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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