# Servoy 9 warning "...is not applicable for..."

**URL:** https://forum.servoy.com/t/servoy-9-warning-is-not-applicable-for/14484
**Category:** Classic Servoy
**Created:** [August 14, 2011, 2:22pm UTC](https://forum.servoy.com/t/servoy-9-warning-is-not-applicable-for/14484 "2011-08-14T14:22:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tgs](https://avatars.discourse-cdn.com/v4/letter/t/f19dbf/32.png) [@tgs](https://forum.servoy.com/u/tgs)
#### Post date: [August 14, 2011, 2:22pm UTC](https://forum.servoy.com/t/servoy-9-warning-is-not-applicable-for/14484/1 "2011-08-14T14:22:35Z")

</div>

Hi!

I get the warning “The function login(String,Object,Array) is not applicable for the arguments (String,String,Array)”  
in this login method in the authenticator modul:

```auto
function gm_login(vUser,vPwd) {
	//check if user name exists
	if(vUser){
		var vUid = security.getUserUID(vUser); //get the uuid
		//check if user exists
		if(vUid){
			//check if password exists
			if(vPwd){
				if(security.checkPassword(vUid,vPwd)){
					var vGroups = security.getGroups().getColumnAsArray(2); //'Administrator', 'Users'
					//login
					var ok = security.login(vUser,vUid,vGroups);
.
.

```

If I take the sample code for security.login():

```auto
var groups = new Array()
groups[0] = 'Administrators'; //normally these groups are for example received from LDAP
var user_uid = globals.email; //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')
}

```

I get the same warnig!?  
A little help would be nice for fixing this.

---

<div class="post-metadata">

### Author: ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)
#### Post date: [August 16, 2011, 11:49am UTC](https://forum.servoy.com/t/servoy-9-warning-is-not-applicable-for/14484/2 "2011-08-16T11:49:31Z")

</div>

2 ways to solve this

cast it:

```auto
/**
  * @type {Array<String>}
  */
var groups = new Array();

```

or directly created it as a String array:

```auto
var groups = ['Administrators']

```

will update the sample.

---

<div class="post-metadata">

### Author: ![tgs](https://avatars.discourse-cdn.com/v4/letter/t/f19dbf/32.png) [@tgs](https://forum.servoy.com/u/tgs)
#### Post date: [August 16, 2011, 12:32pm UTC](https://forum.servoy.com/t/servoy-9-warning-is-not-applicable-for/14484/3 "2011-08-16T12:32:05Z")

</div>

Thank you Johan!

It works now without warnings:

```auto
/**
 *
 * @param {String} vUser
 * @param {String} vPwd
 * 
 * 
 * @properties={typeid:24,uuid:"C4ABD2B9-4550-4342-AF94-E636B0160193"}
 */
function gm_login(vUser,vPwd) {
	//check if user name exists
	if(vUser){
		var vUid = security.getUserUID(vUser); //get the uuid
		//check if user exists
		if(vUid){
			//check if password exists
			if(vPwd){
				if(security.checkPassword(vUid,vPwd)){
					/**
					 * @type {Array<string>}
					 */
					var vGroups = security.getGroups().getColumnAsArray(2); //'Administrators', 'Users'
					//login
					var ok = security.login(vUser,vUid,vGroups);
					if(ok == true){
						return 0;
					}
					else {
						return null;
					}
				}
				//password did not match
				else {
					return 1;
				}
			}
			//user did not enter password
			else {
				return 2;
			}
		}
		//user did not match in security
		else {
			return 3;
		}
	}
	//user did not enter user name
	else {
		return 4;
	}
}

```
