Basic Authentication in Sitecore 10

Wish you all a very Happy New Year 2023😊

In today’s blog I will discuss the basic authentication implementation is Sitecore 10. Basic Authentication may be required for you to protect and restrict the page, and website access from the external source or you can apply it on the UAT, staging, or prod before going live.

ba-sitecore-102-1

You can implement it multiway either by Sitecore Pipeline or Global.asax page. Here I will describe the Sitecore pipeline approach, issues, and solutions.

I would like to give the credit to the original blog post mentioned here, but in Sitecore 10 you will need to perform some extra steps that I will describe in this blog.

Pipeline:

Config file:

After execution of it, you will get the below infinite loop issue:

ba-sitecore-102-2

Solution:

Add the below key in your web.config:

<add key="owin:AutomaticAppStartup" value="false" />

Next, you will get the credential windows and after entering it, it will show the below error "No owin.Environment item was found in the context."

ba-sitecore-102-3

To resolve this issue:

  1. Go to the path {your Sitecore root instance}\App_Config\Include\Examples and copy the “Sitecore.Owin.Authentication.Disabler.config.example” and “Sitecore.Owin.Authentication.IdentityServer.Disabler.config.example” files and paste it into your Visual Studio Solution and remove the .example extension.
  2. Publish your project.

Now you will get the login screen look like this:

ba-sitecore-102-4

Happy Sitecoreing ðŸ˜Š

Comments

Popular posts from this blog

Sitecore Installation Error: Failed to Start Service 'Sitecore Marketing Automation Engine'

Import CSV Data in Sitecore Using PowerShell: Part-3

Sitecore : The database principal owns a schema in the database, and cannot be dropped message