Interface SecurityAuthenticator
- All Known Implementing Classes:
JAASSecurityAuthenticator,SecurityAuthenticatorSupport
public interface SecurityAuthenticator
A
SecurityAuthenticator allows to plugin custom authenticators, such as JAAS based or custom implementations.-
Method Summary
Modifier and TypeMethodDescriptiongetName()Gets the name of the realm.getUserRoles(Subject subject) Gets the user roles from the givenSubjectlogin(HttpPrincipal principal) Attempts to login thePrincipalon this realm.voidAttempt to logout the subject.voidSets the name of the realm to use.voidsetRoleClassNames(String names) Sets the role class names (separated by comma)
-
Method Details
-
setName
Sets the name of the realm to use. -
getName
String getName()Gets the name of the realm. -
setRoleClassNames
Sets the role class names (separated by comma) By default if no explicit role class names has been configured, then this implementation will assume theSubjectPrincipals is a role if the classname contains the word role (lower cased).- Parameters:
names- a list of FQN class names for rolePrincipalimplementations.
-
login
Attempts to login thePrincipalon this realm. The login is a success if no Exception is thrown, and aSubjectis returned.- Parameters:
principal- the principal- Returns:
- the subject for the logged in principal, must not be null
- Throws:
LoginException- is thrown if error logging in thePrincipal
-
logout
Attempt to logout the subject.- Parameters:
subject- subject to logout- Throws:
LoginException- is thrown if error logging out subject
-
getUserRoles
Gets the user roles from the givenSubject- Parameters:
subject- the subject- Returns:
- null if no roles, otherwise a String with roles separated by comma.
-