Copied to clipboard

Flag this post as spam?

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


  • Kresten Banke 36 posts 56 karma points
    Jul 28, 2010 @ 12:59
    Kresten Banke
    0

    Programically login a member on protected page

    Hi all,

    I have a page on which I have created a role based restriction.

    On this page I wish to login a user progracally, since the user is returning from our payment service provider who 'messes up' our initial login.

    I use the username and pw returned in a querystring to login the member. It workes perfectly if the page is not restricted. However, when I turn on the restriction for the page, I am automatically redirected to the log-in page...

    What do I have to do in order to login before I am redirected to the login-page? I have tried placing my 'login method' in my usercontrol on both Page_Load and Page_Init, but it doesn't seem to make a difference...

    Hope that you can help...

    Regards

    Kresten

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Jul 28, 2010 @ 13:03
    Ismail Mayat
    0

    Kresten,

    What about using a bit of jquery to pick up the querystring params and fill in the username and password then trigger the login button click?

    regards

    Ismail

  • Kresten Banke 36 posts 56 karma points
    Jul 28, 2010 @ 13:16
    Kresten Banke
    0

    That could be an idea!

    Do you have an example of doing so?

  • Sascha Wolter 615 posts 1101 karma points
    Jul 28, 2010 @ 13:42
    Sascha Wolter
    0

    Not ideal and a bit of a hack:

    When you have been redirected to the login page read out the previous query string (via HttpContext.Current.Request.UrlReferrer, don't know if it works though), if it contains a username and password automatically log in the user upon which Umbraco should redirect you back to the page you orginally wanted the user to go to.

    Not ideal as visiting the login page is an extra roundabout...

Please Sign in or register to post replies

Write your reply to:

Draft