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>

No comments:

Post a comment