Passing UserGUID to the Custom Role Provider

Discussion in 'ASP .Net' started by Temoc, Jun 22, 2010.

  1. Temoc

    Temoc Guest

    I am implementing a Custom Membership and Role Provider against SQL Database
    using Visual Studio 2010.
    Most of the data on the website is associated with the UserGUID rather than
    the UserName. On the membership provider I am storing the userGUID as
    follows:
    HttpContext.Current.Session.Add("UserGuid",System.Convert.ToString(reader["UserGuid"]));
    I can easily access this value on any of web pages However on my Custom Role
    Provider the HttpContext.Current.Session is null.
    Question 1
    Where do I store the UserGUID on my membership provider so I access it on
    my Role Provider?
    Question 2
    I would like also to cache the roles for the logged user so that
    GetRolesForUser(string username) won’t have to be accessing the database
    every time the user changes pages instead I would read it from cache if
    available. Where would be a secure place to store these values?

    Thanks for the help
     
    Temoc, Jun 22, 2010
    #1
    1. Advertising

  2. Temoc

    Mr. Arnold Guest

    Temoc wrote:
    > I am implementing a Custom Membership and Role Provider against SQL Database
    > using Visual Studio 2010.
    > Most of the data on the website is associated with the UserGUID rather than
    > the UserName. On the membership provider I am storing the userGUID as
    > follows:
    > HttpContext.Current.Session.Add("UserGuid",System.Convert.ToString(reader["UserGuid"]));
    > I can easily access this value on any of web pages However on my Custom Role
    > Provider the HttpContext.Current.Session is null.
    > Question 1
    > Where do I store the UserGUID on my membership provider so I access it on
    > my Role Provider?
    > Question 2
    > I would like also to cache the roles for the logged user so that
    > GetRolesForUser(string username) won’t have to be accessing the database
    > every time the user changes pages instead I would read it from cache if
    > available. Where would be a secure place to store these values?


    You would cache the information on a back-end application Web server,
    and you would retrieve the information using a Web service. The Web
    service would read cache first (cache on a timer) and if null for the
    user, the service would go back to the database and persist it back to
    cache on the back-end application Web server.

    As far as the GUID what's wrong in passing it as a parm on the URL to
    every page on a Response Redirect to the page?
     
    Mr. Arnold, Jun 22, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QmVuIFIu?=

    debug a custom membership and role provider?

    =?Utf-8?B?QmVuIFIu?=, Mar 27, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    3,854
    =?Utf-8?B?dWxyaWNoIHNjaHVtYWNoZXI=?=
    May 17, 2006
  2. CK

    Custom Role Provider

    CK, Jul 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    5,077
    Winista
    Jul 25, 2006
  3. Alias
    Replies:
    5
    Views:
    682
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Feb 18, 2007
  4. Tom Van den Brandt

    Custom role provider not working

    Tom Van den Brandt, May 31, 2007, in forum: ASP .Net
    Replies:
    8
    Views:
    5,554
    rwiethorn
    Jun 11, 2007
  5. sloan
    Replies:
    1
    Views:
    514
    Chad Scharf
    Jul 3, 2007
Loading...

Share This Page