Copied to clipboard

Flag this post as spam?

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


  • F 19 posts 39 karma points
    Aug 29, 2011 @ 08:46
    F
    0

    How to log a user to the backend programmatically?

    Hello,

    I would like to create a control that would log my users to the backend (to avoid having them using the "/umbraco/login.aspx" page.

    What i have so far is a standard login control, plugged on the user membership provider (not members), and a login status to check that the user is logged.

    What happens is this : I log in using the login control, it logs me in, and my login status is "logged in", but i still have no access to the backend, and must go through  "/umbraco/login.aspx" and fill its login form if I want to access the backend.

    Is there anything I missed?

    Thank you,
    F

  • Rich Green 2246 posts 4008 karma points
    Aug 29, 2011 @ 08:56
    Rich Green
    0

    Hey,

    I don't have the exact answer for you.

    However you could downloaded the Umbraco source code (if you haven't already done so) and track exactly what gets set when the the user fills submits their username/password (in /umbraco/login.aspx)

    Rich

  • F 19 posts 39 karma points
    Aug 29, 2011 @ 09:54
    F
    0

    Thank you,

    I will download the sources and see what happens in login.aspx.
    I had to understand and duplicate what was happenning in the method "doLogin"  which is a methode of th "BasePage" object.

    I hope it can help others with similar needs.

    Thank you,
    F

  • Bex 444 posts 555 karma points
    Aug 31, 2011 @ 16:32
    Bex
    0

    This is how I've done it before (They have to enter their username)

        User u = new User(userName);
    doLogin(u);
    Response.Redirect("umbraco.aspx");

    doLogin is under the  umbraco.BasePages.BasePage namespace

     

    HTH

    Bex

Please Sign in or register to post replies

Write your reply to:

Draft