org.n52.security.authentication.callbacks
Class CredentialsCallbackHandler

java.lang.Object
  extended by org.n52.security.authentication.callbacks.CredentialsCallbackHandler
All Implemented Interfaces:
javax.security.auth.callback.CallbackHandler

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

Class CredentialsCallbackHandler reacts on CredentialCallbacks.

A user can add credentials to this handler and if login modules ask for the classes, the credentials are provided by this handler.

Version:
$Revision: $
Author:
Marko Reiprecht Created on 18.07.2008

Constructor Summary
CredentialsCallbackHandler()
           
 
Method Summary
 CredentialsCallbackHandler add(Credential credential)
          Method adds a new credential to the available set.
 void handle(javax.security.auth.callback.Callback[] callbacks)
          Method handles CredentialCallbacks, special behavior is implemented for NameCallbacks and PasswordCallbacks, both are mapped to UsernamePasswordCredential.class callbacks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CredentialsCallbackHandler

public CredentialsCallbackHandler()
Method Detail

handle

public void handle(javax.security.auth.callback.Callback[] callbacks)
            throws java.io.IOException,
                   javax.security.auth.callback.UnsupportedCallbackException
Method handles CredentialCallbacks, special behavior is implemented for NameCallbacks and PasswordCallbacks, both are mapped to UsernamePasswordCredential.class callbacks.

Specified by:
handle in interface javax.security.auth.callback.CallbackHandler
Parameters:
callbacks - the callbacks.
Throws:
java.io.IOException - if error occurs.
javax.security.auth.callback.UnsupportedCallbackException - if error occurs.

add

public CredentialsCallbackHandler add(Credential credential)
Method adds a new credential to the available set. Credentials of the same type replaces the first added.

Parameters:
credential - the credential.
Returns:
CredentialsCallbackHandler.


Copyright © 2004-2009 52north.org. All Rights Reserved.