2
0

FormsIdentity.cs 738 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // System.Web.Security.FormsIdentity
  3. //
  4. // Authors:
  5. // Gonzalo Paniagua Javier ([email protected])
  6. //
  7. // (C) 2002 Ximian, Inc (http://www.ximian.com)
  8. //
  9. using System;
  10. using System.Security.Principal;
  11. namespace System.Web.Security
  12. {
  13. [Serializable]
  14. public sealed class FormsIdentity : IIdentity
  15. {
  16. FormsAuthenticationTicket ticket;
  17. public FormsIdentity (FormsAuthenticationTicket ticket)
  18. {
  19. this.ticket = ticket;
  20. }
  21. public string AuthenticationType
  22. {
  23. get {
  24. return "Forms";
  25. }
  26. }
  27. public bool IsAuthenticated
  28. {
  29. get {
  30. return true;
  31. }
  32. }
  33. public string Name
  34. {
  35. get {
  36. return ticket.Name;
  37. }
  38. }
  39. public FormsAuthenticationTicket Ticket
  40. {
  41. get {
  42. return ticket;
  43. }
  44. }
  45. }
  46. }