I have added remember me features that handles both regular login and social login at a time. #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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;