rakesh ramesan wrote:
i have this application which gives an evaluation time period for its users, for the same i have obtained and store the installation date locally.. now my application needs to restrict login for its users once the grace period is timed out.. what is the best way to implement this..
Could you clearify the bold text?
thanks Minh ..
all what i am trying to implement is to add an evaluation license to my application,
the evaluation version is availbale for use for 30 days and once this grace period is expired the user should not be able to login to the application unless he purchase the application (enters a new license key) , what i am trying to do is, restrict any more logins if the evaulation period is expired
1 of 1 people found this helpful
If i were you, i would implement in following way:
1. For user using trial version, create and store somewhere a token that expires in 30 days (removed from its storage). Denote this storage as S1.
2. For user that has purchased for license, create a token with id = license key and store it in S2.
3. Create a JAAS login module that searchs for token in S2 first, then S1. The login module returns silently if non-null token could be found from either S2 or S1.
thanks for the reply.. i implemented the same by extending the login module ... how can i pass my custom message validation message to the default login.jsp.. for the purpose i am throwing an LoginException with my custom messgae if my validation failed .. but which variable holds this message ..how can i display it back to the user.. <%=res.getString("UILoginForm.label.SigninFail")%> is holding the same message for every login failure
You could config form-error-page in web.xml and display error message in associated servlet/jsp
but the real problem i am faceing is to differenciate between the the type of exception .. in my case i need to display if its an evaluation period failed message or a invalid username/password exception..