Can security.Login() be used outside an Auth module?

I´m trying to use the security.Login() method outside an Authenticator module but it always return false. Is that because it must be used inside an Auth module?

The reason I need to get this is because the solution I´m working on can be used by anonymous users and login is only requiered to access to some options. What I´m doing is, after the user clicks on the special option, get the credentials and try to login but it does not work.

Please any clue on this?

Juan,

Is this webclient or smartclient?

For webclient you can use a solution that has no login solution and no login form, and set mustAuthenticat to false.
This works for anonymous access.

If you do the same for smartclient, Servoy will fall back to the built-in management and will pop-up a login dialog.

Rob

Hi Robert, thanks for yiur reply.
It is a webclient solution and what Im trying to get is that the login form be shiwn only in a part of the solution, just to validate administrators users.
What I need is that when a user tries to enter in the admin area a login form be shown and use the authenticator methods.
I can reach the methods thru globals.mymethod() but I cannot do a security.login() because it always returns false

Hi Juan,

this should be possible, I do kind of the same but during login. Without actually do a login for the administrator.

What you want is just verify his/her password:

var _userUID	= security.getUserUID(_userName);
	var _result		= security.checkPassword(_userUID, _password);
	var _groups		= security.getUserGroups(_userUID); // all the groups associated to the current user
	var _groupnames	= _groups ? _groups.getColumnAsArray(2) : new Array();

	return (_result && _groupnames.indexOf('Administrators') > -1)

the variables _userName and _password are passed to the method.

Hope this helps