Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Web;
- using System.Web.Services;
- using System.Web.Services.Protocols;
- [WebService(Namespace = "http://tempuri.org/")]
- [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
- public class AuthenticateUserService : System.Web.Services.WebService
- {
- [WebMethod]
- public bool AuthenticateUser(string username, string passhash)
- {
- // Fake authentication for the example
- return (username == "jon" && passhash == "SomeHashedValueOfFoobar");
- }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- // Now we can easily authenticate user in our code
- AuthenticateUserService authenticationProxy =
- new AuthenticateUserService();
- bool isUserAuthenticated =
- authenticationProxy.AuthenticateUser("jon", SomeHashMethod("foobar"));
- }
Add Comment
Please, Sign In to add comment