Login Control LoggedIn event is user Authenticated

Discussion in 'ASP .Net' started by Shimon Sim, May 25, 2006.

  1. Shimon Sim

    Shimon Sim Guest

    I am working with LogIn control and need to set some property for profile
    after user is authenticated. I thought that LoggedIn event is the right
    place but system tells me that the property can't be set for anonymous user.
    I checked User.Identity.IsAuthenticated = false. So when is the good place
    to set profile properties? Again I need to set up it only once right after
    user logged in.
    Thank you.
     
    Shimon Sim, May 25, 2006
    #1
    1. Advertisements

  2. Shimon Sim

    Guest Guest

    Shimon,
    To enable profile operation for the anonymous user, you must add this to
    your web.config (along with other items):

    <system.web>
    <anonymousIdentification enabled="true"/>
     
    Guest, May 26, 2006
    #2
    1. Advertisements

  3. Hello Shimon,

    As other member has mentioned, you need to first enable
    "anonymousIdentification" and also set those certain profile properties to
    "allowAnonymous" accessing. And as for the Login control's "LoggedIn"
    event, it is specific to the login page scope which can let us do some
    operation on the page to update the UI after the user has clicked login
    button and successfully loggedin. However, that that event time, the
    HttpContext.User(or the profile service identity) is still not updated yet,
    so this event is not quite suitable for your task.

    Based on my research, if you want to adjust some profile properties after
    the user has loggedIn(change from anonymousIdentity to a valid
    authenticated identity), you can use the ProfileModule's "MigrateAnonymous"
    event which will get fired after the user has loggedIn and this event is
    specific to profile service. You can migrate some profile properties' value
    from original anonymous identity to the authenticated identity:

    #ProfileModule.MigrateAnonymous Event
    http://msdn2.microsoft.com/en-us/library/system.web.profile.profilemodule.mi
    grateanonymous.aspx

    Hope this helps.

    Regards,

    Steven Cheng
    Microsoft Online Community Support


    ==================================================

    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.

    ==================================================


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



    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    Steven Cheng[MSFT], May 31, 2006
    #3
  4. Hey Shimon,

    How are you doing on this issue, does my last reply helps you a little? If
    there is anything else we can help, please feel free to post here.

    Regards,

    Steven Cheng
    Microsoft Online Community Support


    ==================================================

    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.

    ==================================================


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



    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    Steven Cheng[MSFT], Jun 8, 2006
    #4
  5. Shimon Sim

    Shimon Sim Guest

    Thanks
    I didn't know that you answered anything till now. For some reason Outlook
    Express missed it.
    I just checked in on the web - using web reader.
    Thanks it was helpful.
     
    Shimon Sim, Jun 8, 2006
    #5
  6. You're welcome Shimon,

    Feel free to post here when you need any help:)

    Regards,

    Steven Cheng
    Microsoft Online Community Support


    ==================================================

    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.

    ==================================================


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



    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    Steven Cheng[MSFT], Jun 9, 2006
    #6
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.