Deeplink login

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Deeplink login

Postby Janssenjos » Mon Jan 18, 2010 11:08 am

Hi,

We want to use the deeplinking to login in servoy.
Our setup is as followed, we deeplink to a global solution which calls our login method. But after a succesfull login, our custom login page is showed instead of the default form.

Is there something were doing wrong?

(See the attachment for our sample solution)
Attachments
Deeplink.zip
(8.56 KiB) Downloaded 383 times
Jos Janssen
Software Developer
Axerrio
http://www.axerrio.com
Janssenjos
 
Posts: 148
Joined: Thu Aug 13, 2009 3:55 pm
Location: Bergen op Zoom

Re: Deeplink login

Postby Andrei Costescu » Wed Jan 20, 2010 3:51 pm

Make sure security.login() parameters are valid (check that uid and username are not null).

When those are ok then you are probably running into a problem that is fixed in future builds - the security.login(...) calls your method loginmethod(...) that calls back the security.login(...) and so on.
The workaround would be to make sure loginmethod(...) calls are not overlapping. Something like:

Code: Select all
var inside = 0;

function loginmethod( usr,  pwd)
{
   if (inside == 1) return;
   inside = 1;
   
   try {
      (... method code ...)
   } finally {
      inside = 0;
   }
}
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Deeplink login

Postby Janssenjos » Mon Jan 25, 2010 3:04 pm

Thanks for your answer.

I tried your solution, but it still isn't working correctly.

It seems that cause the solution is set to mustAuthenticate, the function in the deeplink isn't called. But instead you get the login screen, cause you need to login(mustAuthenticate).
When I log in and then try the deeplink login again, it works.

So is there a solution or workaround for this, so we can make a deeplink login? (I don't want to disable mustAuthenticate)
Jos Janssen
Software Developer
Axerrio
http://www.axerrio.com
Janssenjos
 
Posts: 148
Joined: Thu Aug 13, 2009 3:55 pm
Location: Bergen op Zoom

Re: Deeplink login

Postby Andrei Costescu » Mon Jan 25, 2010 3:11 pm

What version of Servoy do you use?
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Deeplink login

Postby Harjo » Mon Jan 25, 2010 3:44 pm

yeah, we filed a case a long time ago about this.

this is the response we got from Andrei:

When you check the "Solution needs login" (and specify a login form or not), the global method specified in the deeplink will only execute after the login has been performed. So after the "security.login(...)" function is called in case you have a login form, the global method from the link will execute. This does work from what I tested. Executing methods from URL before login would be a security risk - as anyone would be able to execute any of the global methods without logging in, just by using an URL.
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Deeplink login

Postby Janssenjos » Mon Jan 25, 2010 4:41 pm

Ok, so as I understand, there is just no way to have a external login page then?
Jos Janssen
Software Developer
Axerrio
http://www.axerrio.com
Janssenjos
 
Posts: 148
Joined: Thu Aug 13, 2009 3:55 pm
Location: Bergen op Zoom

Re: Deeplink login

Postby Andrei Costescu » Mon Jan 25, 2010 4:44 pm

Harjo wrote:(...)this is the response we got from Andrei:(...)


I already forgot about that :P . Yes, you are both right, you can't do that as it would mean anyone could call any of your global methods.
I just tested a bit before and it worked because I was using the same browser session where I was logged in earlier... :oops:
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: Deeplink login

Postby jcompagner » Tue Jan 26, 2010 5:32 pm

Janssenjos wrote:Ok, so as I understand, there is just no way to have a external login page then?


what we could try to do in a next version of servoy is that you can give arguments to the onload/onshow method of a the Login form.
So that when some identifier is given to that onload/onshow method you can test this and do the logon directly through your login form. (not even really showing it)

you could make a case for this if you would like something like that.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Deeplink login

Postby pbakker » Tue Jan 26, 2010 5:58 pm

You can already deeplink into a solution and perform automatic login, just not using a method.

Just specify extra parameters on the url and in the onLoad of your login form check the startup arguments (application.getStartupArguments()) and if you receive the proper arguments (whatever you determine) log the user in and automatically the onsolutionstart method will fire and the first form will be shown.

See http://wiki.servoy.com/display/DOCS/Smart+Client and http://wiki.servoy.com/display/DOCS/Web+Client for the options to specify arguments on the url's

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: Deeplink login

Postby Harjo » Tue Jan 26, 2010 8:42 pm

Paul is this really true?

we checked this before, if you specify a global method with arguments, the method with arguments are only fired, when you are (already) logged in
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Deeplink login

Postby pbakker » Tue Jan 26, 2010 8:55 pm

Ofcourse it's true or else I wouldn't be saying it! :)

But, you haven't read what I said. I said "not with a method"

Big difference...

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: Deeplink login

Postby Harjo » Tue Jan 26, 2010 11:26 pm

ah oke, thanks for pointing that out! :)
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: Deeplink login

Postby mboegem » Wed Jan 27, 2010 9:16 am

pbakker wrote:I said "not with a method"


We use a deeplink to pass credentials, but at the time building this I found that I couldn't pass arguments without at least specify a global method in my deeplink as well.
To workaround this, I just created an empty global method 'login' which does nothing (as it's empty :) )

The handling of the arguments is as Paul pointed out from the 'onLoad' on the loginform.
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1750
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Deeplink login

Postby Janssenjos » Thu Jan 28, 2010 12:39 pm

pbakker wrote:
http://wiki.servoy.com/display/DOCS/Web+Client for the options to specify arguments on the url's

Paul


This really helped out, thanks.
Jos Janssen
Software Developer
Axerrio
http://www.axerrio.com
Janssenjos
 
Posts: 148
Joined: Thu Aug 13, 2009 3:55 pm
Location: Bergen op Zoom

Re: Deeplink login

Postby rogel » Thu Oct 27, 2011 6:38 am

mboegem wrote:
pbakker wrote:I said "not with a method"


We use a deeplink to pass credentials, but at the time building this I found that I couldn't pass arguments without at least specify a global method in my deeplink as well.
To workaround this, I just created an empty global method 'login' which does nothing (as it's empty :) )

The handling of the arguments is as Paul pointed out from the 'onLoad' on the loginform.


Can anyone help me how to go about this? I am doing a deeplink login as well to automate the process inside the solution. Would the onLoad method of the login form require argument[0] to be of type JSEvent? How will the arguments be read?
here is the deeplink
[url]localhost:50020/servoy-client/backuprestore.jnlp?m=start_autobackup&a=c:\dbbackup&username=abc&password=123[/url]
rogel
 
Posts: 264
Joined: Mon Jul 04, 2011 9:09 am

Next

Return to Web Development

Who is online

Users browsing this forum: No registered users and 7 guests