How to Do Login & Authenticator in TiNG?

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

How to Do Login & Authenticator in TiNG?

Postby john1598360627 » Thu Oct 27, 2022 2:57 am

I'm trying to figure out how to properly setup the Login Form and Authenticator in TiNG.

On my main solution, this is what I gather are the options.

SOLUTION
* firstForm
* loginForm
* loginSolutionName
* mustAuthenticate

From what I'm understanding, the firstForm appears... but if a loginForm is chosen THAT will appear before the firstForm IF 'mustAuthenticate' is toggled on.

Also, I assume 'loginSolutionName' is deprecated, since Login & Authenticator Solution types are to be deprecated.


WHAT I WANT TO DO
What I want to do is;
1. Set a loginForm that is a formcontainer
- a form container as the login form, so I can have multiple forms related to login.
- login, reset password

2. ONLY Authenticate when login is successful
- What is the code for confirming the authenticator?

3. Switching to the 'firstForm' after authentication
- does switching to firstForm happen automatically after authentication?
john1598360627
 
Posts: 169
Joined: Tue Aug 25, 2020 3:03 pm

Re: How to Do Login & Authenticator in TiNG?

Postby mboegem » Thu Oct 27, 2022 8:54 am

Hi John,

the steps you planned out for login are exactly right.
You are correct that you don't need the loginSolutionName as NG doesn't require a separate login/auth module from a security perspective.

As for step 2 and 3
Once you checked everything you need to check in order to verify the user, you simply call security.login() which takes 3 parameters. (Please see security node in the solution explorer)
After this the solution will automatically switch to the application 'firstForm'

Example on login: security.login('user@domain.com', application.getUUID(), ['User'])
As a note on the array of groups (last parameter): the named group(s) must actually exist on the server to make the login successful.
You can find any of the groups available in the 'User and group security' in the solution explorer.
Also make sure you will import the required groups when deploying.

Side note:
I've recently opened a case on this, because there's currently no warning in the application log when you try to login using a non-existing group.
https://support.servoy.com/browse/SVY-17557

Hope this helps
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: How to Do Login & Authenticator in TiNG?

Postby john1598360627 » Fri Oct 28, 2022 2:34 am

mboegem wrote:Hi John,

the steps you planned out for login are exactly right.
You are correct that you don't need the loginSolutionName as NG doesn't require a separate login/auth module from a security perspective.

As for step 2 and 3
Once you checked everything you need to check in order to verify the user, you simply call security.login() which takes 3 parameters. (Please see security node in the solution explorer)
After this the solution will automatically switch to the application 'firstForm'

Example on login: security.login('user@domain.com', application.getUUID(), ['User'])
As a note on the array of groups (last parameter): the named group(s) must actually exist on the server to make the login successful.
You can find any of the groups available in the 'User and group security' in the solution explorer.
Also make sure you will import the required groups when deploying.

Side note:
I've recently opened a case on this, because there's currently no warning in the application log when you try to login using a non-existing group.
https://support.servoy.com/browse/SVY-17557

Hope this helps

Thank you so much for explaining this! :mrgreen:
john1598360627
 
Posts: 169
Joined: Tue Aug 25, 2020 3:03 pm


Return to How To

Who is online

Users browsing this forum: No registered users and 6 guests