Deeplink login

mboegem:
Hi Rogel,

what I mean is that you should read the arguments in the ‘doActionBypassLogin’ method.
something like this:

function doActionBypassLogin()

{
var _args = arguments;
// now you can work with the arguments as you like…
}




Don't use the application.getStartupArguments() (which is deprecated in v6 anyway...)

Can you site how the onload method of the login will look like?

not sure if the onOpen method will be fired if a session already exists in another tabpanel.
But it will look more or less the same as I showed you in the other method.

rogel:
http://x.x.x.x:x/servoy-client/sampledeeplink.jnlp?m=doActionBypassLogin&a=xyz&username=abc&password=123

I wouldn’t do this anyway, the username and password would travel in clear from the browser to the server, they could be logged by proxies, routers and sniffed by virtually anyone.

indeed!, use https, or use for example not a password, but an generated UUID-token…

ngervasi:
I wouldn’t do this anyway, the username and password would travel in clear from the browser to the server, they could be logged by proxies, routers and sniffed by virtually anyone.

Harjo:
indeed!, use https, or use for example not a password, but an generated UUID-token…

If you use UUID for your user records, you can pass this UUID for example.

I used a UUID myself in a kind of blog-system.
Login to the solution was only validated by the existance of the UUID of a certain blog-item
This case the UUID is different for each deeplink to the solution. (as long as your pointing to different blogrecords…)

mboegem:

ngervasi:
I wouldn’t do this anyway, the username and password would travel in clear from the browser to the server, they could be logged by proxies, routers and sniffed by virtually anyone.

Harjo:
indeed!, use https, or use for example not a password, but an generated UUID-token…

If you use UUID for your user records, you can pass this UUID for example.

I used a UUID myself in a kind of blog-system.
Login to the solution was only validated by the existance of the UUID of a certain blog-item
This case the UUID is different for each deeplink to the solution. (as long as your pointing to different blogrecords…)

Yes, we are using UUID for the username. The password is from the URL is encrypted. I just sited an example. :)

It is still not working. :( What I am missing?

I would need to call processBackup after a successful login using the parameters passed from the deeplink.

This is how I did it
smart client deeplink url http://localhost:8080/servoy-client/backuprestore.jnlp?m=start_autobackup&a=c:\dbbackup&username=B33BCB08-C4B3-4197-A57F-C924128D5AF4&password=qwerty

in solution backuprestore
loginSolutionName = login
mustauthenticate=unchecked
solution onopen = globals.backuprestore_onopen(event)
create start_autobackup in globals.js

function start_autobackup()
{
	application.output("start_autobackup")
}

function processBackup() {
}

in login solution
mustauthenticate=checked
onload form login, assign onLoadBypassLogin(event) found in login.js

function onLoadBypassLogin(event) {
	application.output("onLoadBypassLogin");
	var _arg0 = arguments[0]
	application.output(_arg0)
	var param1 = arguments[1]['username']
	var param2 = arguments[1]['password]
	application.output("param1="+param1)
	application.output("param2="+param2)
if(security.authenticate(LGN_SOLUTION, LGN_METHOD_LOGIN, [param1, param2)])) {
        return true;
}
}

Very Confusing!

Can I ask a simple question about this deeplinking with advanced security:

if i link to http://{url}/ss/s/mysolution/a/myargument

and i have a login solution call my solution_login, which is a module of my solution with advanced security.

then will the onOpen method of the login solution return

application.output(arguments[0]) as ‘myargument’ ??

In order to restore a webclient deeplink, I am finding it hard to get to first base, which appears to be the need to have my argument passed into the Login modules onOpen. It wont go to the solution onOpen as this is only triggered after login!

All help appreciated.

David

Solved!

Simple guidance for anyone else trying this in Servoy 6.

  1. You must not use a method simply a single argument (but can split it with a eliminator:
    http://www.yoursite.com/servoy-webclien … -argument2 (I use -!- as a deliminator as no one would be stupid enough to put that in a normal sentance!)

  2. This argument is received by the Login module in your advanced security solution in the onOpen method

function CxLogin_onSolutionOpen(arguments) {
	
	if (arguments){
	var args=arguments.split('-!-')
	globals.login_username=args[0]
	globals.login_password=args[1]
		//This runs a login from deeplink - used to process corex local cases
		application.output(globals.login_username+ ' '+globals.login_password)
		forms.login.bypasslogin();
		
	}
}
  1. I have used a method on my login form to bypass the normal login script as I was using this from another solution and didn’t want to see a visual output. If you wanted to login then there would be nom harm in actually triggering your normal login method as you have pre-populated in this case the username and password.

  2. Following that the onOpen method of your main solution will then be triggered as normal.