FormsAuthentication.Encrypt problem

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default FormsAuthentication.Encrypt problem

    Hi,

    I have a strange problem. I get NULL reference out of
    Encrypt function.

    FormsAuthenticationTicket ticket = new
    FormsAuthenticationTicket(1,
    userName,
    DateTime.Now,
    DateTime.Now.AddMinutes(30),
    false,
    null,
    FormsAuthentication.FormsCookiePath
    );

    string enc = FormsAuthentication.Encrypt(ticket);

    Variable enc contains NULL reference.

    Thanks in advance.

    Sadashiv
    Sadashiva Hegde Guest

  2. Similar Questions and Discussions

    1. FormsAuthentication Encrypt/Decrypt Problem/Issue
      I'm using the C# sample from MSDN on how to authenticate against an active directory. What I notice is that I get the list of groups placed in the...
    2. DESPERATE: FormsAuthentication Problem
      I am having a very perplexing problem with setting the user's roles. I have tried to figure this out for 2 days now. When the user logs in to the...
    3. FormsAuthentication.Encrypt - algorithm
      Hajo, I have a few questions about above method. 1. AFAIK it is symatric encryption, what kind of algorithm(name) is used in this method? 2....
    4. Encrypt in Perl, De-encrypt in Javascript
      I got a javascript off the net which encrypt and de-encrypt HTML code so that nobody can read the public html file. here is the code of...
    5. Question on the FormsAuthentication.Encrypt method
      I want to encrypt the values of my cookies. I found out that I could create a FormsAuthenticationTicket, and use the FormsAuthentication.Encrypt...
  3. #2

    Default RE: FormsAuthentication.Encrypt problem

    I believe the problem is caused by the lack of user data defined for the
    ticket. In your call to the FormsAuthenticationTicket constructor, you're
    passing "null" for this. Try including some data (string). That should
    work.

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Mark Berryman Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139