toolbox.services.ws
Class SimpleWSS4JServerCallbackLDAPImpl

Package class diagram package SimpleWSS4JServerCallbackLDAPImpl
java.lang.Object
  extended by toolbox.services.ws.SimpleWSS4JServerCallbackLDAPImpl
All Implemented Interfaces:
javax.security.auth.callback.CallbackHandler

public class SimpleWSS4JServerCallbackLDAPImpl
extends java.lang.Object
implements javax.security.auth.callback.CallbackHandler

Simple WSS4J server side CallbackHandler implementation to handle a UsernameToken header.

This implementqtion makes use of an LDAP directory to perform authentication. The implementation is also capable of performing a simple authorisation based on group membership.


Constructor Summary
SimpleWSS4JServerCallbackLDAPImpl()
          Default constructor.
 
Method Summary
 void handle(javax.security.auth.callback.Callback[] callbacks)
          This method expects a single WSPasswordCallback.
 void setGroupNames(java.lang.String groupNames)
          Set a CSV string containing the list of valid group names that are authorised to execute the protected service.
 void setRegistryName(java.lang.String registryName)
          Set the name of the Toolbox ServiceRegistry instance to use.
 void setServiceName(java.lang.String serviceName)
          Set the name of the service instance to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleWSS4JServerCallbackLDAPImpl

public SimpleWSS4JServerCallbackLDAPImpl()
Default constructor.

Method Detail

setRegistryName

public void setRegistryName(java.lang.String registryName)
Set the name of the Toolbox ServiceRegistry instance to use.

Parameters:
registryName - String containing the name of the ServiceRegistry instance to use.

setServiceName

public void setServiceName(java.lang.String serviceName)
Set the name of the service instance to use. This must be a reference to an implementation of the toolbox.services.ldap.simple.SimpleUserService interface.

Parameters:
serviceName - String containing the name of the service instance to use.

setGroupNames

public void setGroupNames(java.lang.String groupNames)
Set a CSV string containing the list of valid group names that are authorised to execute the protected service.

Parameters:
groupNames - CSV string containing the list of valid group names. This is an optional property.

handle

public void handle(javax.security.auth.callback.Callback[] callbacks)
            throws java.io.IOException,
                   javax.security.auth.callback.UnsupportedCallbackException
This method expects a single WSPasswordCallback. The method then proceeds to attempt a simple LDAP bind with the provided identifier and password. If the groupNames property is not null a further check is performed to check the identifiers group membership.

Specified by:
handle in interface javax.security.auth.callback.CallbackHandler
Parameters:
callbacks - Array of Callback instances. This implemenation only expects a single WSPasswordCallback instance.
Throws:
java.io.IOException
javax.security.auth.callback.UnsupportedCallbackException