Pages

14 September, 2020

Enabling Token based authorization for RESTful ItemService in Sitecore 9.3

There is a great number of articles available to enable Token based authorization for RESTful ItemService in Sitecore. Since then it was introduced in Sitecore 8.x, there has been multiple change in namespace for configuring the Signing Provider with the connection string name. 

As per the documentation, the patch for configuring the signing provider for Sitecore 8.2 is here.
<!-- Configuring the Signing Provider for Token Based Authentication for Sitecore 8.2 -->
<configuration>
  <sitecore>
   <api>
    <tokenSecurity>
     <signingProvider type="sitecore.services.infrastructure.sitecore.security.symetrickeysigningprovider, sitecore.services.infrastructure.sitecore">
        <param desc="connectionstringname">sitecore.services.token.securitykey</param>
     </signingProvider>
    </tokenSecurity>
   <api>
  </sitecore>
</configuration>

For Sitecore 9.3, there has been few changes and re-structure to the assembly and namespaces. 
  • Notice that instead of Sitecore.Services.Infrastructure.Sitecore, Sitecore.Services.Infrastructure should be used. 
  • Name of the class has some difference between 8.2 and 9.3 - "SymmetricKeySigningProvider"
<!-- Configuring the Signing Provider for Token Based Authentication for Sitecore 9.3 -->
<configuration>
  <sitecore>
   <api>
    <tokenSecurity>
     <signingProvider type="Sitecore.Services.Infrastructure.Security.SymmetricKeySigningProvider, Sitecore.Services.Infrastructure">
        <param desc="connectionStringName">Sitecore.Services.Token.SecurityKey</param>
     </signingProvider>
    </tokenSecurity>
   </api>
  </sitecore>
</configuration>

10 September, 2020

Sitecore - [Dilithium] Data corruption in master

When using Unicorn to serialize the content and share it with team, there are times when you will end up having inconsistency with the data like having unversioned field data in versioned table in master DB. Because of this, you may get error like "Data Corruption" when you sync using Unicorn. 

[Dilithium] Data corruption in master://{fc5c3451-dfde-4778-9901-5d0b1da1e212}! Field 19a69332-a23e-4e70-8d16-b2640cb24cc8 (unversioned) had a value in the versioned fields table. The field value will be ignored.

When looking for a solution, I found Mikael has written a SQL script which will identify these inconsistencies and provide an option to remove the incorrect data. This will stop this data corruption error message. Thank you Mikael for the script. 

https://mikael.com/2019/11/clean-up-sitecore-database-and-avoid-corrupt-published-content/

https://gist.github.com/mikaelnet/a57faa9a7f9b35b9bba1118787b4266d

01 September, 2020

View the list of installed .NET version

To get the list of .NET version in a windows machine, you can run the below command. 


Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*", "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*" | 
Where {$_.DisplayName -like '*.NET*' -and $_.DisplayVersion -like '4.*'} | Select-Object DisplayName, DisplayVersion
blockquote { margin: 0; } blockquote p { padding: 15px; background: #eee; border-radius: 5px; } blockquote p::before { content: '\201C'; } blockquote p::after { content: '\201D'; }