The cause of my problem had to do with the way I was implementing the Token Provider for Sitecore Services Client.
- I used Tokens for authenticating Sitecore Services Client
- There is a bug in the SigningTokenProvider - when it tries to log an error, such as the Token being expired, it fails to escape special characters correctly, the write to the log fails, and the site blows up.
So, to replace the SigningTokenProvider, I had to also replace the TokenDelegatingHandler. I made an exact copy of the Sitecore's TokenDelegatingHandler, except that it instantiates my SigningTokenProvider instead of Sitecore's. I replaces Sitecore's Token DelegatingHandler with a patch file:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<setting name="Sitecore.Services.Token.Authorization.Enabled">
<patch:attribute name="value">true</patch:attribute>
</setting>
<setting name="Sitecore.Services.SecurityPolicy">
<patch:attribute name="value">Sitecore.Services.Infrastructure.Web.Http.Security.ServicesOnPolicy, Sitecore.Services.Infrastructure</patch:attribute>
</setting>
</settings>
<api>
<tokenSecurity>
<signingProvider type="Sitecore.Services.Infrastructure.Sitecore.Security.SymetricKeySigningProvider, Sitecore.Services.Infrastructure.Sitecore">
<param desc="connectionStringName">Sitecore.Services.Token.SecurityKey</param>
</signingProvider>
</tokenSecurity>
<services>
<configuration type="Sitecore.Services.Infrastructure.Configuration.ServicesConfiguration, Sitecore.Services.Infrastructure">
<allowedControllers hint="list:AddController">
<allowedController desc="EnglishController">DD.Services.Controller.SiteSpecific.XfinityPrepaidDotNet.EnglishPageRepository, DD.Services</allowedController>
<allowedController desc="SpanishController">DD.Services.Controller.SiteSpecific.XfinityPrepaidDotNet.SpanishPageRepository, DD.Services</allowedController>
</allowedControllers>
<delegatingHandlers hint="list:AddDelegatingHandler" patch:instead="delegatingHandlers">
<delegatingHandler desc="TokenDelegatingHandler">
DD.Platform.Sc.EntityServices.TokenDelegatingHandler, DD.Platform.Sc
</delegatingHandler>
</delegatingHandlers>
</configuration>
</services>
</api>
</sitecore>
</configuration>
The problem here is that there is another bug in Sitecore that if I log in this way, even when I log in, my user is returned as not authenticated:
http://borisbrodsky.com/sitecore/issuesolved-sitecore-isauthenticated-property-is-false-for-statlesstoken-based-authentication-in-servicesapicontroller/
So I started messing around with the validation in the TokenDelegatingHandler. What I didnt realize is that a whole bunch of the Analytics parts of Sitecore use this TokenDelegatingHandler to connect. When I changed this, I broke all sorts of analytics components, including whatever was generating that error.
- So, I reverted the TokenDelegatingHandler to be just a copy of Sitecore's except that it calls my SiginingTokenProvider. And my SigningTokenProvider is an exact copy of Sitecore's, except that it handles the errors correctly.
This seemed to eliminate the error. Then I had to move my custom logic that deals with the IsAuthorized problem to an AuthorizationFilterAttribute.
Marketing Definitions
? Also, what is the occurrence of the error? Is it every minute?