Interface TicketComponent
-
- All Known Implementing Classes:
InMemoryTicketComponentImpl
@AlfrescoPublicApi public interface TicketComponentManage authentication tickets- Author:
- andyh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearCurrentTicket()Clear the current ticketintcountTickets(boolean nonExpiredOnly)Count tickets This may be higher than the user count, since a user can have more than one ticket/sessionjava.lang.StringgetAuthorityForTicket(java.lang.String ticket)Get the authority for the given ticketjava.lang.StringgetCurrentTicket(java.lang.String userName, boolean autoCreate)Get the current ticketjava.lang.StringgetNewTicket(java.lang.String userName)Register a new ticketjava.util.Set<java.lang.String>getUsersWithTickets(boolean nonExpiredOnly)Get set of users with tickets This may be lower than the ticket count, since a user can have more than one ticket/sessionbooleangetUseSingleTicketPerUser()Does this ticket component support a single ticket per user or one ticket for each time they login?voidinvalidateTicketById(java.lang.String ticket)Invalidate the tickets by idvoidinvalidateTicketByUser(java.lang.String userName)Invalidate all user ticketsintinvalidateTickets(boolean expiredOnly)Invalidate ticketsjava.lang.StringvalidateTicket(java.lang.String ticket)Check that a certificate is valid and can be used in place of a login.
-
-
-
Method Detail
-
getNewTicket
java.lang.String getNewTicket(java.lang.String userName) throws AuthenticationExceptionRegister a new ticket- Parameters:
userName- String- Returns:
- - the ticket
- Throws:
AuthenticationException
-
getCurrentTicket
java.lang.String getCurrentTicket(java.lang.String userName, boolean autoCreate)Get the current ticket- Parameters:
userName- StringautoCreate- should we create one automatically if there isn't one?- Returns:
- - the ticket
-
validateTicket
@Auditable(parameters="ticket", recordable=false) java.lang.String validateTicket(java.lang.String ticket) throws AuthenticationException
Check that a certificate is valid and can be used in place of a login. Tickets may be rejected because:- The certificate does not exists
- The status of the user has changed
- The user is locked
- The account has expired
- The credentials have expired
- The account is disabled
- The ticket may have expired
- The ticked my be invalid by timed expiry
- An attemp to reuse a once only ticket
- Parameters:
ticket- String- Returns:
- - the user name
- Throws:
AuthenticationException
-
invalidateTicketById
@Auditable(parameters="ticket", recordable=false) void invalidateTicketById(java.lang.String ticket)
Invalidate the tickets by id- Parameters:
ticket- String
-
invalidateTicketByUser
void invalidateTicketByUser(java.lang.String userName)
Invalidate all user tickets- Parameters:
userName- String
-
countTickets
int countTickets(boolean nonExpiredOnly)
Count tickets This may be higher than the user count, since a user can have more than one ticket/session- Parameters:
nonExpiredOnly- true for non expired tickets, false for all (including expired) tickets- Returns:
- int number of tickets
-
getUsersWithTickets
java.util.Set<java.lang.String> getUsersWithTickets(boolean nonExpiredOnly)
Get set of users with tickets This may be lower than the ticket count, since a user can have more than one ticket/session- Parameters:
nonExpiredOnly- true for non expired tickets, false for all (including expired) tickets
-
invalidateTickets
int invalidateTickets(boolean expiredOnly)
Invalidate tickets- Parameters:
expiredOnly- true for EXPIRED tickets, false for ALL (including non-expired) tickets- Returns:
- int count of invalidated tickets
-
getAuthorityForTicket
java.lang.String getAuthorityForTicket(java.lang.String ticket)
Get the authority for the given ticket- Parameters:
ticket- String- Returns:
- the authority
-
clearCurrentTicket
void clearCurrentTicket()
Clear the current ticket
-
getUseSingleTicketPerUser
boolean getUseSingleTicketPerUser()
Does this ticket component support a single ticket per user or one ticket for each time they login?- Returns:
- boolean
-
-