Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have added remember me features that handles both regular login and social login at a time. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jhsbeat
Copy link

@jhsbeat jhsbeat commented Jul 25, 2014

I've added just one class (net.petrikainulainen.spring.social.signinmvc.security.service.CustomPersistentTokenBasedRememberMeServices).
This class handles rememberMeRequested decision only.
The rememberMeRequested returns original results for regular(id/password) login but returns always 'true' for social login.

I have added one checkbox input for 'rememberme' and one hidden input for 'isRegularLogin' in the login.jsp file.
I also have added rememberMe configurations and beans for that in the SecurityContext.java file and exampleApplicationContext-security.xml file.

Please ensure that you have to create a table using the script below for the persistent login before running the application.

CREATE TABLE persistent_logins (
username varchar(64) NOT NULL,
series varchar(64) NOT NULL,
token varchar(64) NOT NULL,
last_used timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (series)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

(net.petrikainulainen.spring.social.signinmvc.security.service.CustomPersistentTokenBasedRememberMeServices).
This class handles rememberMeRequested decision only.
The rememberMeRequested returns original results for
regular(id/password) login but returns always 'true' for social login.

I have added one checkbox input for 'rememberme' and one hidden input
for 'isRegularLogin' in the login.jsp file.
I also have added rememberMe configurations and beans for that in the
SecurityContext.java file and exampleApplicationContext-security.xml
file.

Please ensure that you have to create a table using the script below for
the persistent login before running the application.

CREATE TABLE `persistent_logins` (
  `username` varchar(64) NOT NULL,
  `series` varchar(64) NOT NULL,
  `token` varchar(64) NOT NULL,
  `last_used` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP,
  PRIMARY KEY (`series`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
@jhsbeat
Copy link
Author

jhsbeat commented Aug 10, 2014

Hi Master.

Can you examine my pull request that contains a auto login feature for both of regular login and social login?

Sincerely.

@pkainulainen
Copy link
Owner

I am sorry that it took me forever to answer to you. For some reason I did not get a notification about this pull request.

Thank you for submitting this pull request. It looks good, and I will add the remember me feature to the example application later this year. Unfortunately I cannot merge this pull request right now because

  • I want that the example application is described on my blog.
  • I don't have time to update the blog posts right now.

I hope that you understand.

@diptayandatta
Copy link

Thanks for all your help. It helped me a lot. Appreciate it.

On Sun, Oct 5, 2014 at 10:42 AM, Petri Kainulainen <[email protected]

wrote:

I am sorry that it took me forever to answer to you. For some reason I did
not get a notification about this pull request.

Thank you for submitting this pull request. It looks good, and I will add
the remember me feature to the example application later this year.
Unfortunately I cannot merge this pull request right now because

  • I want that the example application is described on my blog.
  • I don't have time to update the blog posts right now.

I hope that you understand.


Reply to this email directly or view it on GitHub
#1 (comment)
.

With Regards,Diptayan Datta

@raviook
Copy link

raviook commented Jul 4, 2017

Hi jhsbeat,
Can you please send me the source of this project with "remember me" feature!
Thanks & Regards
Ravi Kumar
[email protected]

@keyuls
Copy link

keyuls commented Jun 28, 2018

@jhsbeat can you provide an explanation of how this works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants