|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The IncomingValidator
interface should be implemented by any class if developer wants to validate WS-Security configuration of incoming messages.
The validate(org.systinet.wasp.security.ws.conf.MessageConf)
method is called by WSO2 SOA Enablement Server WS-Security implementation to let
developer/deployer check if incoming message was enough secured by WS-Security (i.e., if there was
security token, signature, encrypted data, etc...).
There are two types of configuration:
WSSEConf.setValidatorClassName
.
In persistent configuration it is a part of service's client or endpoint configuration WSSEProviderConf
,
and default configuration WSSEGlobalConf
.
validate(org.systinet.wasp.security.ws.conf.MessageConf)
method is called.
In deployment descriptor of your service or client it necessary to add dependency to the package of security_providers
in order to use the IncomingValidator
interface.
On the service, the service package has to be referenced, on the client, the clinent package has to be referenced.
Example of runtime class based configuration:
Configurable configurable = Configurator.newRuntimeConfigurable(); WSSEConf securityConf = (WSSEConf)configurable.narrow(WSSEConf.class); ... securityConf.setValidatorClassName( "org.mycompany.validator" ); ... ServiceClient serviceClient = ServiceClient.create(...); MyService ref = (MyService)serviceClient.createProxy( MyService.class ); // set it on service client serviceClient.getContext().getContextData().put(Constants.CD_SECURITY_CONFIGURATION, securityConf); // set it on call context serviceClient.getCallContext().getContextData().put(Constants.CD_SECURITY_CONFIGURATION, securityConf);
Configurable configurable = Configurator.newRuntimeConfigurable(); WSSEConf securityConf = (WSSEConf)configurable.narrow(WSSEConf.class); ... securityConf.setValidatorClassName( "org.mycompany.validator" ); ... ServiceEndpointContext serviceEndpointContext = Current.getServiceEndpointContext(); // set it on the service endpoint serviceEndpointContext.getContextData().put(Constants.CD_SECURITY_CONFIGURATION, securityConf); // or set it on call context - this code must be called in processing (e.g., service's code, validator,...) Current.getCallContext().getContextData().put( Constants.CD_SECURITY_CONFIGURATION, securityConf);
contextdata
under
the key Constants.CD_VALIDATOR_INSTANCE
of Call Context, Service Endpoint or Service Client.
validate(org.systinet.wasp.security.ws.conf.MessageConf)
method is called.
Example of runtime instance based configuration:
IncomingValidator myValidatorInstance = ...your validator instance... ServiceClient serviceClient = ServiceClient.create(...); MyService ref = (MyService)serviceClient.createProxy( MyService.class ); // set it on the service client serviceClient.getContext().getContextData().put(Constants.CD_VALIDATOR_INSTANCE, myValidatorInstance); // set it on call context serviceClient.getCallContext().getContextData().put(Constants.CD_VALIDATOR_INSTANCE, myValidatorInstance);
IncomingValidator myValidatorInstance = ...your validator instance... ServiceEndpointContext serviceEndpointContext = Current.getServiceEndpointContext(); // set it on the service endpoint serviceEndpointContext.getContextData().put(Constants.CD_VALIDATOR_INSTANCE, myValidatorInstance); // or set it on call context - this code must be called in processing (e.g., service's code, validator,...) Current.getCallContext().getContextData().put(Constants.CD_VALIDATOR_INSTANCE, myValidatorInstance);
Method Summary | |
void |
validate(MessageConf wsSecIncomingMessageConf)
Called by WS-Security implementation. |
Method Detail |
public void validate(MessageConf wsSecIncomingMessageConf) throws WSSecurityException
wsSecIncomingMessageConf
- incoming message's configuration of WS-Security.
WSSecurityException
- thrown when incoming message is not secured enough
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |