Expand persistent logins

satya - 6/12/2017, 1:05:58 PM

what to expand

Current persistence is kept in memory. This needs to be moved to disk or a database. Otherwise every week when the server restarts the logins revert to non persistent logins. There is also a limitation on how many devices persistent logins can take place from. This needs to be increased to 5 or so.

satya - 6/12/2017, 1:07:10 PM

Key immediate activities

Increase number of logins

Locate where I have documented persistent logins before and list those links here

Save the persistence to a file or database

Prepare the test bed locally

Get a functioning copy of the program locally

satya - 6/12/2017, 1:14:08 PM

Previous research on persistent logins

Previous research on persistent logins

satya - 6/18/2017, 3:42:17 PM

New functionality

Allow multiple logins from multiple devices

Keep persistent login persistent even if the server has restarted

However there is no gate keeper to limit the number of devices. (may be that can be implemented fairly easily. Perhaps next iteration)

The login data is kept on a local file for now.

satya - 6/18/2017, 3:44:43 PM

Test script 1

Restart server

login

enable pls

restart server

Ensure the pls sticks

This proves data is being saved to file and retrieved

satya - 6/18/2017, 3:45:49 PM

Test script 2: sticky login on one device

login

enable pls

login (if necessary)

see the login sticks on that device

satya - 6/18/2017, 3:48:09 PM

Test script 3: Sticky login is not spread

Pre: pls enabled

login on sticky device

ensure it is sticky

login from a diff device

should be prompted for login

satya - 6/18/2017, 3:49:55 PM

Test script 4: Sticky login on 2 browsers same device

Test script 4: Sticky login on 2 browsers same device

satya - 6/18/2017, 3:50:20 PM

Test script 5: Sticky login from 2 different devices

Test script 5: Sticky login from 2 different devices

satya - 6/18/2017, 3:51:02 PM

Test script 6: Examine the files being written for stickyness on the server

Test script 6: Examine the files being written for stickyness on the server

satya - 6/18/2017, 3:53:01 PM

Closing 1: Note changes to properties files

Closing 1: Note changes to properties files

satya - 6/18/2017, 3:53:10 PM

Closing 2: Note changes to java class files

Closing 2: Note changes to java class files

satya - 6/18/2017, 3:54:06 PM

Closing 3: See if an pencil based quick interaction diagram to be posted

Closing 3: See if an pencil based quick interaction diagram to be posted

satya - 6/18/2017, 3:55:32 PM

Closing 4: Outline the following

XML conversion - a summary

Java i/o File and string streams - asummary

New blogs/features in Java

satya - 6/18/2017, 4:07:12 PM

Next steps: 6/18/17


//Research phase
Concurrency research complete
XML research complete

//coding
Coding is complete
Property files updated locally

//local testing
start local server
see which database it is pointing to
Use local powerpoint as guide
See if I can get the site up local

//Run tests

satya - 6/19/2017, 11:01:01 AM

Changes to properties file


* -- This class implements looking up random keys for a user
 * -- if the user has logged in before
 * request.aspire.authentication.persistentSupportLoginObject.classname= * com.ai.aspire.authentication.pls.PersistentLoginSupport2
 *
 * -- This class is invoked by the previous class
 * -- to store the user login satus persistently in a file.
 * request.aspire.authentication.plsDataPersistenceObject.classname= * com.ai.aspire.authentication.pls.PLSDataSetFilePersistence
 * 
 * -- This is the filename used by the class above
 * -- Being stored in the web-inf location it is not visible
 * aspire.authentication.plsDataPersistenceFilename= * aspire:\\web-inf\\aspire\\temp\\persistent-login-info.xml

satya - 6/19/2017, 11:04:34 AM

High level design

Change PLSPersistentLoginSupport2 class so that

1: It is synchronized across multiple logins and threads

2: Every state change invokes a save to a local drive of the state of persistent logns

3: state is kept in a hashmap. This state is converted to a list first and streamed as xml to the local drive

4: jaxb with annotations is used to save the resulting xml

5: FileUtils.translateFileIdentifier() is used to get access to the filename needed to read and write from

6: No changes to the underlying protocol of digest based logins

satya - 6/19/2017, 12:02:13 PM

Changes to the akc code


//3 property lines have been added for PLS under authentication
C:\satya\data\codebase\akc-sqlserver\properties\aspire.properties

//This was added prior to this release
//to define stored procedure execution rights to the 
//logged in database user.
\WEB-INF\aspire\stored-procedures\sp_createExecuteRole.sql

satya - 6/19/2017, 2:11:37 PM

Deploy: Make sure to create /aspire/temp directory to hold the login state file

Deploy: Make sure to create /aspire/temp directory to hold the login state file

satya - 6/19/2017, 2:12:09 PM

Deploy: Remove xalan jar file

This seem to be conflicting with Jaxb! Dependency crap!!

satya - 6/19/2017, 6:17:32 PM

Changed aspire source files


Listing files that have changed since 04-15-2017
~17 files

//Created a utility method for creating implementations
\com\ai\application\utils\AppObjects.java

//Release notes
C:\satya\data\codebase\aspire_jsdk23_eclipse\src\com\ai\aspire\AspireReleaseNotes.java
//Release number
C:\satya\data\codebase\aspire_jsdk23_eclipse\src\com\ai\aspire\AspireReleases.java

//Two constants were added under authentication
\com\ai\servlets\AspireConstants.java

//Adjusting to the slightly modified ILoginSupport class
\com\ai\aspire\authentication\DigestAuthenticationWithPersistentLoginMethod.java

//A replace method is added
\com\ai\aspire\authentication\IPersistentLoginSupport.java

//Class for saving the login data to a file
\com\ai\aspire\authentication\pls\IPLSDataSetPersistence.java

//Dataset that represents the login data to be saved
\com\ai\aspire\authentication\pls\LoggedInUserKeysDataset.java
\com\ai\aspire\authentication\pls\PLSUserDetail.java
\com\ai\aspire\authentication\pls\PersistentLoginSupportTestDriver.java
\com\ai\aspire\authentication\pls\PLSDataSetFilePersistence.java

//Old class 
\com\ai\aspire\authentication\pls\PersistentLoginSupport.java

//New implementation that takes into saves
\com\ai\aspire\authentication\pls\PersistentLoginSupport2.java

//A few utility methods based on aspire file names
\src\com\ai\common\FileUtils.java

//Some documentation changes
\src\com\ai\common\Utils.java
\src\com\ai\parts\RemovePersistentLoginPart.java

satya - 7/3/2017, 1:27:47 PM

Bug: Still intractable

works ok across server restarts

seem to work ok across devices

But once in a while I mysteriously loose session.

I see 2 jsession ids. This might be explainable for the root context and the /akc context. May be these two sessions are thrashing each other.

I cannot tell when this happens exactly to reproduce.

Likely scenario may be a) login and see if it is properly working when I use the folder contents view b) After a sufficient gap when the sessions may expire try to access private document (not the folder). And see if that succeeds. For example use the private "questions" folder.