Create Custom Login Page Mixed authentication SharePoint 2013

SharePoint Developer Blog

Hi folks,

In series of my SP2013 blogs my this blog describes how to “Create Custom Login Page Mixed authentication in SharePoint 2013“.

It is bit similar to SP2010 with a small change of the master page it inherits and sharepoint assembly version. So below is my code to achieve login functionality for “Windows Authentication” and “Forms Authentication“.

ASPX Page(Application Page):

Note: 1. Some things you must replace those are highlighted below.

2. Master page used for mixed mode login page is errorv15.master

3. I override click event of login button that default use CommandName=”Login”

4. Also you can use either  <%–<a href=”/_windows/default.aspx?ReturnUrl= or  <asp:LinkButton ID=”lbInternalUsers” … former is easy but less in control from code, later best for controlling events.

<%@ Assembly Name="Microsoft.SharePoint.IdentityModel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
 
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="YourPageName.aspx.cs" Inherits="YourNameSpace.YourClassName" MasterPageFile="~/_layouts/15/errorv15.master" %> <%@ Import Namespace="Microsoft.SharePoint.WebControls" %> <%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %> <asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">     <SharePoint:EncodedLiteral runat="server" EncodeMethod="HtmlEncode" ID="ClaimsFormsPageTitle" /> </asp:Content> <asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">     
             
    <script language="javascript">         if (document.location.protocol != 'https:') {             var SslWarning = document.getElementById('SslWarning');             SslWarning.style.display = ''…

Ver la entrada original 213 palabras más

Anuncios

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s