FormsAuthenticationTicket does not return userdata

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

  1. #1

    Default FormsAuthenticationTicket does not return userdata

    Hello,

    I am trying to get FormAuthentication working, but the FormsAuthenticationTicket does not return the UserData. Does any one have any insight into this?

    To create a Authorization ticket, I am using this code:

    //grab the roles for this user. Pipe delimited string.
    string roles = RetrieveRoles(custID);
    //roles now equals something like "Manager|User"



    //create an auth ticket.
    FormsAuthenticationTicket authTicket =
    new FormsAuthenticationTicket(
    1,
    custID,
    DateTime.Now,
    DateTime.Now.AddMinutes(10),
    false,
    roles
    );


    To get the roles I am using this code:

    string[] roles = authTicket.UserData.Split(new char[]{'|'});

    Thanks

    Stewart

    ---
    Posted using Wimdows.net NntpNews Component -

    Post Made from [url]http://www.DotNetJunkies.com/newsgroups[/url] Our newsgroup engine supports Post Alerts, Ratings, and Searching.
    shaddock@-NOSPAM-gmail.com Guest

  2. Similar Questions and Discussions

    1. FormsAuthenticationTicket UserData bug in framework 1.1, how to report it?
      Seems pretty incredible a simple "how to report a bug" isn't available at all on Microsoft.com !! How the hell can we report a bug when we find one?...
    2. FormsAuthenticationTicket
      I've followed the suggestions in MSDN > MSDN Library > .NET Developpment > .NET Securuty > Bulding Secura ASP.BET application article but the cookie...
    3. UserData size limit in a FormsAuthenticationTicket
      Is there a size limit to the userData in a FormsAuthenticationTicket ? I'm asking this because when I try to encrypt the FormsAuthenticationTicket...
    4. FormsAuthenticationTicket timeout
      Hi, What is the difference between the timeout parameter in FormsAuthenticationTicket constructor and timeout attribute in the authentication...
    5. How do you add userdata in maya?
      Does anyone know how to add userdata in Maya, I can't seem to find it in the documentation or on google? Thanks Tim
  3. #2

    Default Re: FormsAuthenticationTicket does not return userdata

    Recently I ran into the same behavior.

    I decided to use FormsAuthentication.RedirectFromLoginPage(userName ,
    False) instead of
    Response.Redirect(FormsAuthentication.GetRedirectU rl(userName, False)).

    RedirectFromLoginPage issues an authentication ticket which then blows
    away your ticket. Granted this is a comment I wrote in my blog a while
    back but have a suspicion this may help you.

    Joseph E Shook [MVP - ADSI] 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