My new blog present here.

Featured Post

Insights into Sitecore Search: A Definitive Introduction

A key component of digital experience management is effective information retrieval. A simplified approach is required for websites, applications, and platforms containing a lot of material so that consumers can easily get the data they require. This need is met by Sitecore, a well-known name in the field of digital experience platforms (DXPs), which provides powerful and comprehensive search functionality. We will travel into the realm of Sitecore Search in this article, learning about its capabilities, architecture , and the enormous value it offers both developers and end users. Introduction to Sitecore Search    A headless content discovery platform powered by AI , Sitecore Search enables you to build predictive and custom search experiences across various content sources. To extract and ...

Add password reset page in Form Based Authentication MOSS 2007 site

Add password reset page in Form Based Authentication MOSS 2007 site:

Overview:

This article explains how to add a reset password page in Form Based Authentication enable SharePoint 2007 (MOSS) site, so the user can reset his/her password. We will add this page in standard menu.

Problem:

When you enable forms authentication on SharePoint 2007 (MOSS), it means that users credentials are stored in membership database like ASP.NET database. In Form Based Authentication site, if we want to reset password then reset password page should be accessible to anonymous user also.

Solution:

We are going to add new feature (ResetPasswordPage feature) in the standard user menu:

1. Write code .cs file(c# file), In this class, we will inherit the class Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase

For example:

public class ExtranetPasswordReset_Test : Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase


2. Creating ExtranetPasswordReset_Test.aspx
3. Creating ResetPasswordPage feature
4. Deployment

1. Creation of ExtranetPasswordReset_Test.aspx:

We will create new ExtranetPasswordReset.aspx with the help of VS 2005.

<%@ Assembly Name="Microsoft.SharePoint,Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" Inherits="Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase" MasterPageFile="~/_layouts/simple.master" %>
<%@ Assembly Name="Test.Security, Version=3.0.0.0, Culture=neutral, PublicKeyToken=8b7a42e9b9b5355f" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>



Site Title:




Code behind file of ExtranetPasswordReset_Test.aspx, called ExtranetPasswordReset_Test.aspx.cs:

1. We need add two functions:
I. protected override bool AllowAnonymousAccess
II. protected void Page_Load(object sender, EventArgs e)






2. Inherit the class with UnsecuredLayoutsPageBase class.







namespace Test.Security.Web.UI
{


public class ExtranetPasswordReset_Test : Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase
{
protected override bool AllowAnonymousAccess
{
get
{
return true;

}
}
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Test");
}


}
}









2. Create ResetPasswordPage feature:

We will create Feature file and put into the ResetPasswordPage folder inside the Feature folder.










We also need to create elements.xml file.










Set CustomAction properties as shown, Location to be ‘StandardMenu’ and UrlAction URL property should be “_layouts/ExtranetPasswordReset_Test.aspx”
3. Deployment
1. Copy ‘ExtranetPasswordReset_Test.aspx’ file to the following path:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\
2. Copy ResetPasswordPage folder that contains elements.xml and feature.xml to the following path: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\

3. run the following command:










Now the feature is installed successfully, but needs to be activated.

4. Go to your site-> Site Actions -> Site Settings -> Modify All Site Settings->Site Collection Features ->Activate ResetPasswordPage feature.

Now you can find Reset Password action in the standard user menu

Comments

Popular posts from this blog

Sitecore GraphQL Queries

Sitecore Experience Manager Cloud (XM Cloud) Building blocks

Configuring Sitecore Next.js Headless SXA Multisite App in a Sitecore Container