Authentication service fix.

Clean context if login fails or ticket validation falis

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2030 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2005-12-13 09:29:22 +00:00
parent dbb20b17ab
commit 8e31d3ba1b
3 changed files with 100 additions and 4 deletions

View File

@@ -88,7 +88,15 @@ public class AuthenticationServiceImpl implements AuthenticationService
public void authenticate(String userName, char[] password) throws AuthenticationException
{
authenticationComponent.authenticate(userName, password);
try
{
authenticationComponent.authenticate(userName, password);
}
catch(AuthenticationException ae)
{
clearCurrentSecurityContext();
throw ae;
}
}
public String getCurrentUserName() throws AuthenticationException
@@ -108,7 +116,15 @@ public class AuthenticationServiceImpl implements AuthenticationService
public void validate(String ticket) throws AuthenticationException
{
authenticationComponent.setCurrentUser(ticketComponent.validateTicket(ticket));
try
{
authenticationComponent.setCurrentUser(ticketComponent.validateTicket(ticket));
}
catch(AuthenticationException ae)
{
clearCurrentSecurityContext();
throw ae;
}
}
public String getCurrentTicket()