# Servoy 6 Security Login

**URL:** <https://forum.servoy.com/t/servoy-6-security-login/14430>\
**Category:** Classic Servoy\
**Created:** [August 7, 2011, 10:01am UTC](https://forum.servoy.com/t/servoy-6-security-login/14430 "2011-08-07T10:01:15Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [August 7, 2011, 10:01am UTC](https://forum.servoy.com/t/servoy-6-security-login/14430/1 "2011-08-07T10:01:15Z")

</div>

Hi,

I am trying to get to grips with having to use the enhanced security in 6.

So I have changed my login form (using a database search) to be the login for in the solution.

I have defined a group called ‘Experts’ and I have written the following code:

```auto
var groups = new Array()
				groups[0] = 'Experts'; //normally these groups are for example received from LDAP
				var user_uid = globals.userid; //also this uid might be received from external authentication method
				var ok = security.login(globals.username, user_uid, groups)
				if (!ok) {
					plugins.dialogs.showErrorDialog('Login failure', 'Already logged in? or no user_uid/groups specified?', 'OK')
				}

```

The username is a string, the globals.userid defined from searching my table based on username and password.

This triggers a ok=false and the error as if I am already logged in, but I am not.

Any clues, otherwise my solution brings up the servoy form when i put it onto the production server.

David

---

<div class="post-metadata">

**Author:** ![lwjwillemsen](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/lwjwillemsen/32/4987_2.png) [@lwjwillemsen](https://forum.servoy.com/u/lwjwillemsen)\
**Post date:** [August 7, 2011, 10:50am UTC](https://forum.servoy.com/t/servoy-6-security-login/14430/2 "2011-08-07T10:50:04Z")

</div>

Hi David,

With Servoy enhanced security enabled you must use an authentication module with which you communicate from within the login form.

Read the Servoy Wiki on this…

Regards,
