In AD Authentication mode, how to use form logon instead of Windows pop-up window

Source: Internet
Author: User
Tags tagname

After using Moss for so long, some people adopt ad authentication and some adopt form authentication. Our company adopts the intermediate replacement method, because it is not very convenient to use form authentication, for example, you need to open two ports. I personally share my experience with you. If you do not have the right or have a better solution, contact me.

 

1. Cause

Why do we need to perform form login? By default, moss adopts ad authentication because the user is stored as ad by default. If someone wants to combine the user with the previous system, use formal form authentication for development.

I want to talk about ad authentication today. A bad way for AD authentication is to bring up a dialog box, and the interface is unfriendly, for example, it is impossible for me to forget the password on the interface.

 

1. PNG(28.73 K) 19:46:08

</P>

Now we will teach you a simple method of submitting using forms. In fact, this method was implemented very early on the 11th day. It is not complicated. I just improved it a little.

 

1. First, use anonymous access.

1.1enable anonymous access in IIS.

2. PNG(11.46 K) 19:46:40

</P>

1.2 The Authentication provider must be enabled. Operation Method: Administration Center -- Application Management -- Application Security -- Verification provider -- default

 

3. PNG(18.17 K) 19:46:56

</P>

1.3 enable Anonymous Website access. The operation is website operations> advanced permissions> Settings> anonymous access, as shown below:

4. PNG(18.57 K) 19:47:22

<Br> </P>

2. Set the logon page

We need to develop a logon interface. Enter the user. Password.

5. PNG(215.05 K) 19:49:53

</

This logon interface can be placed under the _ layouts/directory.

See the attachment for the logon interface code.

You need to change the following addresses:

The http://www.cnblogs.com/sharepoint/test/default.aspx interface is the interface to be verified (the default website has been opened anonymous, just need to verify to another non-Anonymous Access address)

Http: // 10.49.28.7 this is the interface we want to return

If not. You can access the http://keji.lickies.cn to view.

 

3. after logon, the system automatically jumps to the logon interface. Because we have enabled anonymity, we can access it by default. Therefore, we need to add a program, if the ad user is null, the logon page is displayed.

One way is to add a usercontrol in masterpage.

 

What should we do? Open the default 12/template/globral/Default. Master (if there is a change, go to the SPD)

In

<% @ Register tagprefix = "wssuc" tagname = "welcome" src = "~ /_ Controltemplates/welcome. ascx "%>

Add
<% @ Register tagprefix = "wssuc" tagname = "login" src = "~ /_ Controltemplates/chklogin9.ascx "%>

 

In <body scroll = "yes" onLoad = "javascript: If (typeof (_ spbodyonloadwrapper )! = 'Undefined') _ spbodyonloadwrapper (); ">

Add

<Wssuc: Login ID = "chklogin" runat = "server" enableviewstate = "false"> </wssuc: Login>

Many people may ask what chklogin. ascx is.

This is our user control. The file is as follows. Attachments can be downloaded ..

 

<% @ Control Language = "C #" inherits = "Microsoft. Sharepoint. applicationpages. webcontrols. actionbar, Microsoft.

Sharepoint, version = 12.0.0.0, culture = neutral, publickeytoken = 71e9bce111e9429c "compilationmode =" always "%>
<% @ Register tagprefix = "wssawc" namespace = "Microsoft. Sharepoint. webcontrols" assembly = "Microsoft. Sharepoint, version = 12.0.0.0, culture = neutral,

Publickeytoken = 71e9bce111e9429c "%> <% @ register tagprefix =" SharePoint "namespace =" Microsoft. sharepoint. webcontrols "assembly =" Microsoft. sharepoint, version = 12.0.0.0, culture = neutral, publickeytoken = 71e9bce111e9429c "%>
<%

If (httpcontext. Current. User. Identity. Name. tostring () = "")
{
Response. Redirect ("/_ layouts/web/login. aspx ");
}

%>

Put this file under c: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ template \ controltemplates.

I wrote about it. If you have any questions, contact the QQ group.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.