Custom authentication and Login()

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Custom authentication and Login()

Postby AlanBourke » Thu Oct 13, 2011 11:09 am

I am trying to implement some custom authentication using Login and Authentication solutions. I have created my own user and group db and tables, because I need to extend what the default Servoy implementation provides. In other words I am not using the repository and not using Servoy's own authentication.

Given the above, from the examples that I have looked at I am unclear as to how much I need to handle myself.

In my authentication solution, I can validate the supplied user name and password against my own user table with my own code, but do I also need to call security.login() to let Servoy know or something ?

If my authentication solution returns a true to the login solution, do I need to handle that myself and manually launch the first form, or should Servoy be doing that automatically as it would if I were using Servoy's own security ?
-------------------------------------------------------------------------------------------
Servoy SAN Developer
User avatar
AlanBourke
 
Posts: 198
Joined: Tue Aug 02, 2011 3:32 pm
Location: Dublin, Ireland

Re: Custom authentication and Login()

Postby rgansevles » Fri Oct 14, 2011 9:04 am

Alan,

Have you seen this:
http://wiki.servoy.com/display/public/D ... g+Security

Servoy runs the authenticator in the server when the client calls security.authenticate() in the login solution.
When in the authenticator, security.login() is called, the calling client will switch automatically from login solution to first form of main solution.
When the authenticator does not call security.login() (for example because the password was wrong), the calling client will stay in the login solution.

Note that you can also use the security.authenticate() method to retrieve some data stored in the db, you may need this because as long as the calling client is not logged in it has no db access.

Hope this helps.

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: Custom authentication and Login()

Postby AlanBourke » Tue Oct 25, 2011 5:49 pm

Thanks Rob.

Yes I was working from that documentation that you linked to.

What I have is my own tables in my own DB that I am using to hold user login details (because I need to have additional information there, and did not want to modify the Servoy repository schema). So in my Authenticate() code I just validate the supplied user name and password against my own tables.

What I am confused about it whether I need to call security.login() in this scenario. Or should returning true from the authentication module enough ?
-------------------------------------------------------------------------------------------
Servoy SAN Developer
User avatar
AlanBourke
 
Posts: 198
Joined: Tue Aug 02, 2011 3:32 pm
Location: Dublin, Ireland

Re: Custom authentication and Login()

Postby rgansevles » Tue Nov 08, 2011 12:26 pm

Alan,

Servoy triggers on the security.login() call in the authenticator solution, the returned value from the method is ignored (it is passed to the security.authenticate()) caller.

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Re: Custom authentication and Login()

Postby akaphilippeassemien » Fri Mar 11, 2016 7:01 pm

hello, i'm new user of Servoy developer

i need help te realise a solution like this:

-in the solution users must login with a user name and a password
-for a firs connexion he need to redefine his password
-the password expire each 3 mouth

help pls
akaphilippeassemien
 
Posts: 2
Joined: Fri Mar 11, 2016 6:53 pm


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 28 guests