Posts

My Sitecore Upgrade Learnings Part 1

Image
Hello Everyone, In this blog I will share my learnings and experience while working on Sitecore upgrade project. Recently we migrated our Sitecore solution from 9.2 with SXA to Sitecore 10.2 with SXA. I will also share my experience regarding what was our approach to implement the same. Sitecore already have a very good document which clearly explains what is needed to upgrade the Sitecore version. If you are upgrading from version prior to Sitecore 9 that this blog will not be that much useful but still you can refer this for some learning purpose. So let's get started. We were having a Sitecore managed cloud in 9.2 with compatible SXA 1.9 installed on it. We started with following approach mentioned below. We got a new Sitecore Manage cloud instance with 10.2 version We installed the Compatible Sitecore PowerShell (6.3 IAR) and SXA version (10.2.0) with respect to 10.2 After successful installation on CM environment, we required to deploy respective SXA modules on CD environmen...

OAuth 2.0 and OpenID implementation in Sitecore Website

Image
Hello everyone, In this blog we will try to see how we can implement OAuth 2.0 and OpenID for Authentication and Authorization. In previous blog post we discuss what is OAuth 2.0 and OpenID and how Sitecore uses the same for Authentication and Authorization. This blog will give you a basic idea that how we can follow Sitecore approach to integrate third party Identity provider. So let's get started. Would recommend everyone to read my previous article on OAuthAndOpenID The first step will be, to create a client page with login button. This button will be responsible for transfering you to Identity Server. We will see how Sitecore does it and will try to use the same logic for our login button logic. Create a Login Controller. This controller will give us the required SignInInfo details which will be passed to Identity Server. You can refer below code. We have created a Login Action method which will call the GetSignInInfo method to get the identity url protected readonl...

Understanding OAuth 2.0 and OpenID Connect with Sitecore

Image
Hello everyone, In this blog we will try to understand Federated Authentication and Authorization concept and will try to see how Sitecore uses this concepts to perform Authentication and Authorization. Let's begin. We will see basic terminology like OAuth 2.0, OpenID Connect etc. which is mostly used in implementing the Federated login mechanism. OAuth 2.0 : OAuth 2.0, which stands for “Open Authorization”, is a standard designed to allow a website or application to access resources hosted by other web apps on behalf of a user. OpenID : OpenID is a unified user identification method released as an open standard that essentially acts as a single user identification system that can be used across multiple websites. It is a wrapper made on top of OAuth 2.0 which provide the functionality of Authentication. Resource Owner : User who is trying to login on an application Client : An Application which provide the interface where user can click on Sign In button. Authorization Server ...

Steps to Enable Sitecore Analytics and Verify Data flow to Shard Databases

Hello everyone, This blog will help us to understand what settings are required to enable Sitecore Analytics in newly installed Sitecore instance. We will also see one common errors which get logged in our logs after setting up of our local instance. We will see the steps required to solve the same. Without wasting time, let's start with the steps. Steps to enable Analytics and verify data is flowing to Shard DB or not 1. Changed the below settings to true in the indexersettings.xml file in xconnect webroot   Path:C:\inetpub\wwwroot\xconnectinstance\App_Data\jobs\continuous\IndexWorker\App_Data\config\sitecore\SearchIndexer      o IndexPIISensitiveData      o IndexAnonymousContactData 2. Rebuilt the xconnect indexes using the following command. Refer  Rebuild XConnectIndex  for same. Path: C:\inetpub\wwwroot\xconnectinstance\App_Data\jobs\continuous\IndexWorker      o Sitecore.XConnectSearchIndexer -rr 3. Rebuilt the Sitecore i...

Understanding Sitecore Role And Virtual User Creation With Use Case

Image
Hello everyone, I am back with another blog. In this blog we will try to understand, how we can create a new Sitecore Domain, how we can create a new Sitecore Role and how we can use the role to restrict the user in backend system from accessing the items in Sitecore. Will try to keep this blog as short as possible. So let's begin. We will try to understand all the above concepts using a use case. This came as a requirement for one of our project. Recently, we got an requirement to restrict some of the logged in user in our website from accessing some of the pages in Sitecore. To overcome this requirement, we have done it by implementing Sitecore Roles and Concept of virtual user in our code behind. Below is the steps which I followed. Step 1: Create a new domain in Sitecore. There are few inbuilt domain which Sitecore automatically provides like Extranet, Sitecore etc. But for our understanding we will create everything new. Go to launchpad once you have logged into Sitecore. In l...

Custom SXA Search Scope Query Token

Image
Hello everyone, In this blog we will see how we can use a custom token in SXA search scope query. What is custom search scope query token and when it is useful. So let's start with understanding what is SXA search scope query token. We all are aware like how search is an important and integral part of any website built using Sitecore. Specially when we are building a website using SXA then most of the time we use Search Result OOTB SXA component for any kind of listing. The Search Result OOTB component primary requirement is Search Scope query. We can build the scope query from Sitecore only where we can define things like Location, Templates etc. Location: Used to help the Solr to get data from specific folder Templates: Used to filter the Sitecore items created from specific templates Many of the time, this suffice to build your search scope query to get the desired results. But we all know, there are times that we need something different from normal scope query to get our resul...

Different ways of Storing Page URL while session expires or User Logout

Hello everyone, In this blog, we will discuss few ways to store last access URL for the users so that we can provide seamless login and same journey for the user.  So recently we got same kind of requirement, where we wanted user to get the last access page if session expires or user is logged out mistakenly. We started exploring different ways. First thing came in mind was to use query string parameter to pass the last access web URL of the page. This works absolutely fine but there are situation where the web page URL can have appended query string parameters. So it will be difficult to pass URL with query string as parameter to login page URL. Also if there are security mechanism like WAF implemented on your website then, there is a high chance it will not allow query string to pass from non-authenticated pages to your controller. This was the same scenario which we were facing. Somehow, the query string was removed automatically while the user was redirecting to login page wh...

Custom Table To Store Sitecore Analytics data in Reporting Database Part 2

Hello everyone, this is continuation to previous blog, Part 1 of this series where we have seen, steps to create custom table in reporting database. Link for the same is here Part 1 This part, we will be concentrating more one the code logic required to update data in the custom table. Let's start with the code part without any delay. We will create 4 classes respectively: CampaignVisitKey.cs : Which will have the key on which the table entry will be done CampaignVisitValue.cs : The value for our columns which will be inserted CampaignVisit.cs : This class is inheriting from Fact table. It merges the current datatable of Campaign visits to existing table CampaignVisitProcessor.cs : This processor executes the actual logic of reading and assigning the values to our model. Let's see the code for all the classes one by one CampaignVisitKey.cs using Sitecore.Analytics.Aggregation.Data.Model; using System; using System.Collections.Generic; using Syste...

Custom Table To Store Sitecore Analytics data in Reporting Database Part 1

Hello everyone, Hope everyone is doing great. This blog is one more addition to my existing blogs list. You can anytime refer my Blog Site for Sitecore related blogs. Hope this blog site will help you in learning something new. Now let's start with todays topic for discussion. In this blog we are going to see how we can create custom table in Sitecore reporting database and how we can write custom aggregation processor to pass all the user define analytics data to our custom tabel similar to how sitecore internally processes the same. This blog will be divided into two parts: We will see how we can create custom table in reporting database along with Store procedure, Table aliases required for the same We will see the custom aggregation code required for the same We will try to understand all this things using a Use Case. Use Case: We need to create a cutom table in reporting db to store all the campaign visited by the Contact along with the dates of visits. Step ...

SXA Variant Token Resolver for Breadcrumb

Image
Hello everyone, I am back with another blog. This time we will discuss something about SXA variant token and how it is useful while creating rendering variants in SXA. We will also discuss a scenario where Variant Token helped us to achieve the required functionality. Let's start without delaying. We were asked to implement a search functionality in SXA. If user search for any keyword, then user must be redirected to search result page where he will be shown all the matched result. So whoever has worked on SXA will be thinking that its simple to implement the required ask using SXA OOTB functionality.  Steps we will be following to achieve the same is: 1. Use the Search Box OOTB component. 2. Configure the required search scope query in Search Box Component 3. Give the Signature and configure the required Search Result Page where the user should be redirected, when someone search for something. 4. On the Search Result Page where we are showing the user all matched results, we will ...