Copied to clipboard

Flag this post as spam?

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


  • David F. Hill 122 posts 242 karma points
    Oct 07, 2010 @ 00:35
    David F. Hill
    0

    Login Programmatically with FormsAuthentication.Authenticate

    Hello Umbraco Colleagues,

    As I understand, Umbraco (v 4.0.2.1) membership supports the ASP.Net membership provider. The ASP.Net Login control works well for this but...
    I need to programmatically login members after they complete the registration form.

    I have tried System.Web.Security.FormsAuthentication.Authenticate() but it fails to authenticate.

    I've read this forum post:
    http://our.umbraco.org/forum/developers/api-questions/9595-Programmatically-login-user-with-MemberAddMemberToCache()
    But it seems odd to revert to an Umbraco API call since we're using the ASP.Net membership provider.

    What's the solution?

    Thanks,

    David Hill

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    Oct 07, 2010 @ 13:21
    Lee Kelleher
    1

    Hi David,

    Have you tried setting the auth cookie manually?

    FormsAuthentication.SetAuthCookie(string userName, bool createPersistentCookie)

    Cheers, Lee.

  • David F. Hill 122 posts 242 karma points
    Oct 07, 2010 @ 17:22
    David F. Hill
    0

    Hi Lee,

    Yes - that's the ticket! (Pun intended.)

    Thanks for the insight.

    David

  • 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