Page 1 of 1

Authenticator mode in NgClient versions 2024.3.1

PostPosted: Fri May 17, 2024 10:50 am
by andrea.caria
Hi, I'm quite new to Servoy and I'm getting started with the Authenticator process.
I've created a solution with NG-client and set the authenticator as AUTHENTICATOR, as explained here https://docs.servoy.com/guides/develop/security/authentication#authenticator
I've created another solution (type: module) labeled as authenticator, but I can't understand how to connect to the stateless login form.
Our goal is to implement in the authenticator solution a LDAP login.
Can you help me explain how the authentication solution is connected to the stateless login form? And what are the best practices for a LDAP login in servoy?
I also attached the screen of the properties of the main solution

Re: Authenticator mode in NgClient versions 2024.3.1

PostPosted: Fri May 17, 2024 3:59 pm
by mboegem
Hi,

welcome to the forum.

The url you've mentioned basically contains all the information you need.
In order to use the stateless login using the authenticator solution.

1) create a media Login Page.
2) set the main solution to authenticator type 'Authenticator'
3) create the authenticator solution and make sure that you create the 'onSolutionOpen' function as explained.
the onSolutionOpen function can be created directly from the properties at solution level.
Concerning creation of the authenticator solution: from your main solution right-click the 'Modules' node and choose 'Create new module', set the solution name and make sure the solution type will become 'Authenticator'

Based on these 3 steps it already works.

Concerning using LDAP, I'm not familiar with that myself.
However in the onSolutionOpen function you will get username/password which you need to verify against LDAP.
Based on the LDAP authentication result, you can then call 'security.login' , which will get you into your main solution.

Hope this helps

Re: Authenticator mode in NgClient versions 2024.3.1

PostPosted: Fri May 17, 2024 4:50 pm
by andrea.caria
Hi [quote="mboegem"], thanks a lot for the answer. The first two steps are quite straightforward, while I'm not sure about the creation of the function "onSolutionOpen" which can be created directly from the properties at solution level.
I have created a function inside the authenticator module in Scopes --> Global
Screenshot 2024-05-17 164124.png
function creation
Screenshot 2024-05-17 164124.png (13.04 KiB) Viewed 1089 times

Then I called the function on the onOpen method

Screenshot 2024-05-17 164513.png
onopen
Screenshot 2024-05-17 164513.png (23.52 KiB) Viewed 1089 times

But the authenticator is not called.
Sorry for the silly question but I can't understand how the login media will call the authenticator.

Re: Authenticator mode in NgClient versions 2024.3.1

PostPosted: Wed May 22, 2024 12:33 pm
by andrea.caria
Hi, thanks a lot for the answer. The first two steps are quite straightforward, while I'm not sure about the creation of the function "onSolutionOpen" which can be created directly from the properties at solution level.
I have created a function inside the authenticator module in Scopes --> Global
Screenshot 2024-05-17 164124.png
function creation
Screenshot 2024-05-17 164124.png (13.04 KiB) Viewed 123 times

Then I called the function on the onOpen method

Screenshot 2024-05-17 164513.png
onopen
Screenshot 2024-05-17 164513.png (23.52 KiB) Viewed 123 times

But the authenticator is not called.
Sorry for the silly question but I can't understand how the login media will call the authenticator.

mboegem wrote:Hi,

welcome to the forum.

The url you've mentioned basically contains all the information you need.
In order to use the stateless login using the authenticator solution.

1) create a media Login Page.
2) set the main solution to authenticator type 'Authenticator'
3) create the authenticator solution and make sure that you create the 'onSolutionOpen' function as explained.
the onSolutionOpen function can be created directly from the properties at solution level.
Concerning creation of the authenticator solution: from your main solution right-click the 'Modules' node and choose 'Create new module', set the solution name and make sure the solution type will become 'Authenticator'

Based on these 3 steps it already works.

Concerning using LDAP, I'm not familiar with that myself.
However in the onSolutionOpen function you will get username/password which you need to verify against LDAP.
Based on the LDAP authentication result, you can then call 'security.login' , which will get you into your main solution.

Hope this helps

Re: Authenticator mode in NgClient versions 2024.3.1

PostPosted: Wed May 22, 2024 12:33 pm
by andrea.caria
Hi, thanks a lot for the answer. The first two steps are quite straightforward, while I'm not sure about the creation of the function "onSolutionOpen" which can be created directly from the properties at solution level.
I have created a function inside the authenticator module in Scopes --> Global
Screenshot 2024-05-17 164124.png
function creation
Screenshot 2024-05-17 164124.png (13.04 KiB) Viewed 123 times

Then I called the function on the onOpen method

Screenshot 2024-05-17 164513.png
onopen
Screenshot 2024-05-17 164513.png (23.52 KiB) Viewed 123 times

But the authenticator is not called.
Sorry for the silly question but I can't understand how the login media will call the authenticator.

mboegem wrote:Hi,

welcome to the forum.

The url you've mentioned basically contains all the information you need.
In order to use the stateless login using the authenticator solution.

1) create a media Login Page.
2) set the main solution to authenticator type 'Authenticator'
3) create the authenticator solution and make sure that you create the 'onSolutionOpen' function as explained.
the onSolutionOpen function can be created directly from the properties at solution level.
Concerning creation of the authenticator solution: from your main solution right-click the 'Modules' node and choose 'Create new module', set the solution name and make sure the solution type will become 'Authenticator'

Based on these 3 steps it already works.

Concerning using LDAP, I'm not familiar with that myself.
However in the onSolutionOpen function you will get username/password which you need to verify against LDAP.
Based on the LDAP authentication result, you can then call 'security.login' , which will get you into your main solution.

Hope this helps