Implementing user authentication using (windows/form/soap/webservice) separately

Source: Internet
Author: User
Tags config soap
Web|window

(i). Implementation of Windows Integrated authentication

1. Description:

Windows authentication uses the existing account information for Windows to authenticate.

IIS provides automatic authentication, more secure than custom authentication, but without the flexibility of custom authentication.

Applies to web internal applications.

Configuring in Web.config: <authentication mode= "Windows"/>

(b). Form authentication

1. Note: Use forms-based authentication. Configure in Web.config:

<authentication mode= "Forms" >
<forms name= ". Aspxcookiedemo "
Protection= "All"
Loginurl= "Login.aspx"
Timeout= "20"
Path= "/" >
<credentials passwordformat= "Clear" >
<user name= "chengking" password= "123"/>
</credentials>
</forms>
</authentication>

where <user name= "chengking" password= "123"/> To configure user logon information for custom
Get this data in your code:

if (FormsAuthentication.Authenticate (Txtuser.text,txtpwd.text))
{
FormsAuthentication.RedirectFromLoginPage (Txtuser.text,false);
}
Else
{
Errmsg.text= "Voucher error, please re-enter";
}

(iii). Implementing Authentication with Soap

1. Notes

Customize a Soaphead store user name and password.

public class Soapauthheader:soapheader
{
public string UserName;
public string userpwd;
}

Then by calling webservice for validation, it is simpler, see the code example.


(iv). Implementing Authentication with WebService

1. Notes

Calling the Sebservice method for authentication


When you download code, be aware of the following:

For the convenience of input, account unification, the above four sample code examples to correctly log in to the account:

Userid:chengking

Passward:123



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.