authenticationService . 404 , Authentication_JSON_AppService.axd winforms. , - JSON.
, #, - VB.NET. http://progtutorials.tripod.com/Authen.htm .
<WebMethod(EnableSession:=True)>
<ScriptMethod(ResponseFormat:=ResponseFormat.Json)>
Public Function Login(ByVal username As String, ByVal password As String) As Boolean
Dim result As Boolean = False
' If (FormsAuthentication.Authenticate(username,password)) ' this may also work to authenticate
If (Membership.ValidateUser(username, password)) Then
FormsAuthentication.SetAuthCookie(username, False)
Dim ticket As FormsAuthenticationTicket = New FormsAuthenticationTicket(username, False, 30)
Dim ticketString As String = FormsAuthentication.Encrypt(ticket)
Dim cookie As HttpCookie = New HttpCookie(FormsAuthentication.FormsCookieName, ticketString)
Context.Response.Cookies.Add(cookie)
result = True
End If
Return result
End Function
WebService web.config.
<location path="Authentication.asmx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>