Class SecurityAuthenticatorSupport
- java.lang.Object
-
- org.apache.camel.component.netty.http.SecurityAuthenticatorSupport
-
- All Implemented Interfaces:
SecurityAuthenticator
- Direct Known Subclasses:
JAASSecurityAuthenticator
public abstract class SecurityAuthenticatorSupport extends Object implements SecurityAuthenticator
A base class forSecurityAuthenticator
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SecurityAuthenticatorSupport.HttpPrincipalCallbackHandler
CallbackHandler
that provides the username and password.
-
Constructor Summary
Constructors Constructor Description SecurityAuthenticatorSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
Gets the name of the realm.String
getUserRoles(Subject subject)
Gets the user roles from the givenSubject
protected boolean
isRoleClass(Principal principal)
Is the given principal a role class?void
setName(String name)
Sets the name of the realm to use.void
setRoleClassNames(String roleClassNames)
Sets the role class names (separated by comma)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.camel.component.netty.http.SecurityAuthenticator
login, logout
-
-
-
-
Method Detail
-
setName
public void setName(String name)
Description copied from interface:SecurityAuthenticator
Sets the name of the realm to use.- Specified by:
setName
in interfaceSecurityAuthenticator
-
getName
public String getName()
Description copied from interface:SecurityAuthenticator
Gets the name of the realm.- Specified by:
getName
in interfaceSecurityAuthenticator
-
setRoleClassNames
public void setRoleClassNames(String roleClassNames)
Description copied from interface:SecurityAuthenticator
Sets the role class names (separated by comma) By default if no explicit role class names has been configured, then this implementation will assume theSubject
Principal
s is a role if the classname contains the word role (lower cased).- Specified by:
setRoleClassNames
in interfaceSecurityAuthenticator
- Parameters:
roleClassNames
- a list of FQN class names for rolePrincipal
implementations.
-
isRoleClass
protected boolean isRoleClass(Principal principal)
Is the given principal a role class?- Parameters:
principal
- the principal- Returns:
- true if role class, false if not
-
getUserRoles
public String getUserRoles(Subject subject)
Description copied from interface:SecurityAuthenticator
Gets the user roles from the givenSubject
- Specified by:
getUserRoles
in interfaceSecurityAuthenticator
- Parameters:
subject
- the subject- Returns:
- null if no roles, otherwise a String with roles separated by comma.
-
-