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...
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...
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
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
That could be an idea!
Do you have an example of doing so?
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...
is working on a reply...