code_junkie

Hiding a queryString in an ASP.NET Webapplication

Nov 11th, 2011
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. using System;
  2. using System.Web;
  3. using System.Web.Services;
  4. using System.Web.Services.Protocols;
  5.  
  6. [WebService(Namespace = "http://tempuri.org/")]
  7. [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  8. public class AuthenticateUserService : System.Web.Services.WebService
  9. {
  10. [WebMethod]
  11. public bool AuthenticateUser(string username, string passhash)
  12. {
  13. // Fake authentication for the example
  14. return (username == "jon" && passhash == "SomeHashedValueOfFoobar");
  15. }
  16.  
  17. }
  18.  
  19. protected void Page_Load(object sender, EventArgs e)
  20. {
  21. // Now we can easily authenticate user in our code
  22. AuthenticateUserService authenticationProxy =
  23. new AuthenticateUserService();
  24. bool isUserAuthenticated =
  25. authenticationProxy.AuthenticateUser("jon", SomeHashMethod("foobar"));
  26. }
Add Comment
Please, Sign In to add comment