org.apache.camel.component.netty.http
Class SecurityAuthenticatorSupport

java.lang.Object
  extended by 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 for SecurityAuthenticator.


Nested Class Summary
static class SecurityAuthenticatorSupport.HttpPrincipalCallbackHandler
          CallbackHandler that provides the username and password.
 
Constructor Summary
SecurityAuthenticatorSupport()
           
 
Method Summary
 String getName()
          Gets the name of the realm.
 String getUserRoles(Subject subject)
          Gets the user roles from the given Subject
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)

By default if no explicit role class names has been configured, then this implementation will assume the Subject Principals is a role if the classname contains the word role (lower cased).

 
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
 

Constructor Detail

SecurityAuthenticatorSupport

public SecurityAuthenticatorSupport()
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 interface SecurityAuthenticator

getName

public String getName()
Description copied from interface: SecurityAuthenticator
Gets the name of the realm.

Specified by:
getName in interface SecurityAuthenticator

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 the Subject Principals is a role if the classname contains the word role (lower cased).

Specified by:
setRoleClassNames in interface SecurityAuthenticator
Parameters:
roleClassNames - a list of FQN class names for role Principal 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 given Subject

Specified by:
getUserRoles in interface SecurityAuthenticator
Parameters:
subject - the subject
Returns:
null if no roles, otherwise a String with roles separated by comma.


Apache Camel