How to make a remember me button in the login

0
Hi everyone, I'm working with anonymous sessions, with a web service, from an active directory. I already have my login working, but I want to create a button that if clicked, the user no longer has to enter their credentials. How can I do this?
asked
1 answers
0

How did you integrated AD? If you use following module for AD; after their login, users remain signed in until their AD session expires. This way you may achieve your desired result without writing custom logic.

 

https://marketplace.mendix.com/link/component/1174

 

If you have a custom login logic, extend Account entity by adding LoginToken attribute. Place a "Remember me" checkbox in the login form and  if the checkbox is true generate a random token for LoginToken and store it in the account entity. Also save this generated token in the user’s browser (e.g. via a cookie using a JavaScript action).

 

When user visits page, login logic shall check if a valid token exists in the user cookie, if a valid token exists in the browser, find the corresponding Account and trigger the log the user in.

answered