Two Methods of domain authentication

Source: Internet
Author: User

Recently, I was working on a project for a customer. The user asked the website to enable single-point login for domain users, instead of entering the user name and password for login. Obviously, the traditional website is set as a basic identity authentication (domain authentication), and the cancellation of anonymous authentication cannot meet the requirements. Is there another way? There are some methods that allow access by both Domain Users and non-Domain Users, and have undergone basic form verification. You can write a shared method. The input parameter is the domain user name and password, and the domain user verifies validity. In this way, the domain user has a user name and two sets of passwords.
The common method is written as follows:

Public Bool Checkdomainuser ( String UID, String PWD)
{
Bool Flag1;
Try
{
If (PWD =   Null   | PWD. Trim (). Length =   0 )
{
Return False;
}
String Spath =   " LDAP: // bqc.corp.com " ;
Directoryentry entry1 =   New Directoryentry (Spath, uid, PWD, authenticationtypes. serverbind );
Object Obj1 = System. runtime. compilerservices. runtimehelpers. getobjectvalue (entry1.nativeobject );
Flag1 =   True ;
}
Catch
{
Flag1= False;
}
Return Flag1;
}

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.