org.idoox.wasp.security.kerberos
Interface KerberosConfig


public interface KerberosConfig

This interface is used for configuration of Kerberos authentication provider. Configuration setting is performed on the client side that initiates GSSContext. If client side wants to connect to a server at "http://abc.com:6060/" that has kerberos principal name "ServicePrincipal" for all services, he may do as follows.

      ServiceClient stubConf = ServiceClient.create(...);

      Configurable config = Configurator.newRuntimeConfigurable();
      KerberosConfig krbConf = (KerberosConfig)config.narrow(KerberosConfig.class);
      KerberosConfig.IdentityPreference idPref =  krbConf.newServiceIdentity();
      idPref.setUri("http://abc.com:6060/");
      idPref.setIdentity("ServicePrincipal");
      KerberosConfig.IdentityPreference prefs []={idPref};
      krbConf.setServiceIdentities( prefs);
      WaspSecurity.setProviderProperties(stubConf, config, "Kerberos");
If client side wants to connect to a service at "http://abc.com:6060/secure/hello/" that has kerberos principal name "ServicePrincipal", he may do as follows.
      ServiceClient stubConf = ServiceClient.create(...);

      Configurable config = Configurator.newRuntimeConfigurable();
      KerberosConfig krbConf = (KerberosConfig)config.narrow(KerberosConfig.class);
      KerberosConfig.IdentityPreference idPref =  krbConf.newServiceIdentity();
      idPref.setUri("http://abc.com:6060/secure/hello/");
      idPref.setIdentity("ServicePrincipal");
      KerberosConfig.IdentityPreference prefs []={idPref};
      krbConf.setServiceIdentities( prefs);
      WaspSecurity.setProviderProperties(stubConf, config, "Kerberos");
If client side wants to connect to a service that has different KDC with ream "EAST_KDC" he may do as follows.
       ServiceClient stubConf = ServiceClient.create(...);

       Configurable config = Configurator.newRuntimeConfigurable();
       KerberosConfig krbConf = (KerberosConfig)config.narrow(KerberosConfig.class);
       krbConf.setServiceRealm("EAST_KDC");
       WaspSecurity.setProviderProperties(stubConf, config, "Kerberos");
 

Component:
Security-Providers

Nested Class Summary
static interface KerberosConfig.IdentityPreference
          For associating service to identity or server to identity.
 
Method Summary
 boolean getPrivateState()
          Returns private state of GSSContext.
 KerberosConfig.IdentityPreference[] getServiceIdentities()
          Returns an array that determines association of service/identity or server/identity.
 java.lang.String getServiceRealm()
          Returns Kerberos realm of the service which the client side wants to connect to.
 KerberosConfig.IdentityPreference newServiceIdentity()
          Creates new instance of IdentityPreference interface.
 void setPrivateState(boolean privateState)
          Sets private state of the GSSContext being created.
 void setServiceIdentities(KerberosConfig.IdentityPreference[] serviceIdentities)
          set associations of service/identity or server/identity to the given value.
 void setServiceRealm(java.lang.String realm)
          Sets Kerberos realm of the service which the client side wants to connect to.
 

Method Detail

getPrivateState

public boolean getPrivateState()
Returns private state of GSSContext. Message will be encrypted if private state is true.

Returns:
boolean value of privateState

setPrivateState

public void setPrivateState(boolean privateState)
Sets private state of the GSSContext being created. Message will be encrypted if privateState is true.

Parameters:
privateState - boolean value of privateState to set to.

getServiceIdentities

public KerberosConfig.IdentityPreference[] getServiceIdentities()
Returns an array that determines association of service/identity or server/identity. See also KerberosConfig.IdentityPreference

Returns:
an array that determines association of service/identity or server/identity

setServiceIdentities

public void setServiceIdentities(KerberosConfig.IdentityPreference[] serviceIdentities)
set associations of service/identity or server/identity to the given value. See also KerberosConfig.IdentityPreference

Parameters:
serviceIdentities - array of associations

newServiceIdentity

public KerberosConfig.IdentityPreference newServiceIdentity()
Creates new instance of IdentityPreference interface.

Returns:
instance of IdentityPreference interface.

getServiceRealm

public java.lang.String getServiceRealm()
Returns Kerberos realm of the service which the client side wants to connect to.

Returns:
Kerberos realm of the service which the client side wants to connect to

setServiceRealm

public void setServiceRealm(java.lang.String realm)
Sets Kerberos realm of the service which the client side wants to connect to.