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