# Deeplink login

**URL:** <https://forum.servoy.com/t/deeplink-login/11630>\
**Category:** Classic Servoy\
**Created:** [January 18, 2010, 9:08am UTC](https://forum.servoy.com/t/deeplink-login/11630 "2010-01-18T09:08:07Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![rogel](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rogel](https://forum.servoy.com/u/rogel)\
**Post date:** [November 22, 2011, 7:39pm UTC](https://forum.servoy.com/t/deeplink-login/11630/21 "2011-11-22T19:39:15Z")

</div>

> mboegem:  
> Hi Rogel,
> 
> what I mean is that you should read the arguments in the ‘doActionBypassLogin’ method.  
> something like this:
> 
> ```auto
> function doActionBypassLogin()
> 
> ```

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

> ```auto
> 
> 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?

---

<div class="post-metadata">

**Author:** ![mboegem](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/mboegem/32/4399_2.png) [@mboegem](https://forum.servoy.com/u/mboegem)\
**Post date:** [November 22, 2011, 9:02pm UTC](https://forum.servoy.com/t/deeplink-login/11630/22 "2011-11-22T21:02:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ngervasi](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@ngervasi](https://forum.servoy.com/u/ngervasi)\
**Post date:** [November 22, 2011, 11:37pm UTC](https://forum.servoy.com/t/deeplink-login/11630/23 "2011-11-22T23:37:21Z")

</div>

> rogel:  
> [http://x.x.x.x](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.

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [November 23, 2011, 5:11am UTC](https://forum.servoy.com/t/deeplink-login/11630/24 "2011-11-23T05:11:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mboegem](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/mboegem/32/4399_2.png) [@mboegem](https://forum.servoy.com/u/mboegem)\
**Post date:** [November 23, 2011, 8:14am UTC](https://forum.servoy.com/t/deeplink-login/11630/25 "2011-11-23T08:14:34Z")

</div>

> 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…)

---

<div class="post-metadata">

**Author:** ![rogel](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rogel](https://forum.servoy.com/u/rogel)\
**Post date:** [November 23, 2011, 7:45pm UTC](https://forum.servoy.com/t/deeplink-login/11630/26 "2011-11-23T19:45:02Z")

</div>

> 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. ![:)]( "Smile")

---

<div class="post-metadata">

**Author:** ![rogel](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@rogel](https://forum.servoy.com/u/rogel)\
**Post date:** [November 28, 2011, 6:24am UTC](https://forum.servoy.com/t/deeplink-login/11630/27 "2011-11-28T06:24:45Z")

</div>

It is still not working. ![:(]( "Sad") 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](http://localhost:8080/servoy-client/backuprestore.jnlp?m=start_autobackup&a=c:%5Cdbbackup&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

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

function processBackup() {
}

```

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

```auto
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;
}
}

```

---

<div class="post-metadata">

**Author:** ![dpearce](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpearce](https://forum.servoy.com/u/dpearce)\
**Post date:** [July 30, 2012, 7:32pm UTC](https://forum.servoy.com/t/deeplink-login/11630/28 "2012-07-30T19:32:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dpearce](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpearce](https://forum.servoy.com/u/dpearce)\
**Post date:** [July 31, 2012, 7:23pm UTC](https://forum.servoy.com/t/deeplink-login/11630/29 "2012-07-31T19:23:30Z")

</div>

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](http://www.yoursite.com/servoy-webclient/ss/s/yoursolutionname/a/argument1-!-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

```auto
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.

[Previous page](https://forum.servoy.com/t/deeplink-login/11630.md?page=1)
