Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Warren Buckley 2106 posts 4836 karma points MVP 8x admin c-trib
    May 20, 2010 @ 10:07
    Warren Buckley
    0

    How do I login a Member from CodeBehind in a Base class?

    Hello all,
    How would I login in a Member from a Base Class?

    What do I need to do?

    • Set a cookie?
    • Use some umbraco API to do this?
    • Or some form of asp.net membership provider stuff?

    Appreciate your help

    Thanks,
    Warren

  • Aaron Powell 1708 posts 3046 karma points c-trib
    May 20, 2010 @ 10:08
    Aaron Powell
    0

    The standard ASP.NET Membership stuff should work, provided that you're invoking a method in base which is on the same domain.

  • Warren Buckley 2106 posts 4836 karma points MVP 8x admin c-trib
    May 20, 2010 @ 10:10
    Warren Buckley
    0

    Thanks Aaron care to share some more details please as I don't know my way round the ASP.NET membership stuff.

    Thats like replying "Yes" to my question, care to expand on it mate ;)

  • Kenneth Solberg 227 posts 418 karma points MVP
    May 20, 2010 @ 10:14
    Kenneth Solberg
    1

    http://msdn.microsoft.com/en-us/library/ff648345.aspx

    See step 4, authenticating users.

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    May 20, 2010 @ 10:17
    Lee Kelleher
    1

    Warren, when you say Base, do you mean /Base (REST)?  (As opposed to an inherited "base" class in .NET)

    There are a set of member library methods for /Base, take a look at:

    umbraco.presentation.umbracobase.library.member.login( loginname, password )

    That will add the member to the cache (cookie/session).  As Aaron mentions, this set a cookie for the domain that /Base is on, so if you are calling it from a different domain, it wont work.

    Good luck, Lee.

     

  • Warren Buckley 2106 posts 4836 karma points MVP 8x admin c-trib
    May 20, 2010 @ 10:27
    Warren Buckley
    2

    Thanks Lee, Aaron and Kenny for all your ideas.

    Quick chat with Lee on this on MSN and the quick easy win is to use the API method

    umbraco.presentation.umbracobase.library.member.login( loginname, password )

    However the proper way would be better to use ASP.NET membership provider stuff, just in case the membership provider changes in the future.

    Warren

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies