|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.systinet.wasp.security.ws.ReferrableElement
org.systinet.wasp.security.ws.SecurityToken
org.systinet.wasp.security.ws.UsernameToken
Represents WS-Security username token.
Example
// create service client instance
ServiceClient serviceClient = ServiceClient.create("http://...");
// authenticate client and set the credentials
Credentials creds = WaspSecurity.acquireClientCredentials("Chris", "sirhC", "WS-Security");
WaspSecurity.setCredentials(serviceClient, new Credentials[]{creds});
WaspSecurity.setInitiatingProvider(serviceClient, "WS-Security");
// create service proxy
ServiceSoap svc = (ServiceSoap) serviceClient.createProxy(ServiceSoap.class);
// create new call security configuration
MessageSecurity ms = new MessageSecurity();
// create username token (password will be sent in plaintext)
UsernameToken usernameToken = new UsernameToken(PasswordOption.TEXT);
// add username token to message security
ms.addToken(usernameToken);
// set call security configuration
ms.setCallSecurity(serviceClient);
// invoke service method
svc.ping("EchoString");
X509Token,
SharedSecretToken| Field Summary |
| Fields inherited from class org.systinet.wasp.security.ws.SecurityToken |
NULL_PROPERTY_CONF_ARRAY |
| Constructor Summary | |
UsernameToken(PasswordOption passwordOption)
Initializes the token with current user credentials. |
|
UsernameToken(java.lang.String alias,
java.lang.String password,
PasswordOption passwordOption)
Initializes the token with current user credentials. |
|
| Method Summary | |
protected java.lang.String |
getEncryptionMethodHint()
Returns encryption method hint. |
protected java.lang.String |
getKeyEncryptionMethodHint()
Returns key encryption method hint. |
protected SecurityTokenConf |
getSecurityTokenConf(MessageConf messageConf)
Creates low-level API token configuration. |
protected java.lang.String |
getSignatureMethodHint()
Returns signature method hint. |
protected java.lang.String |
getTokenReferenceModeHint(SecurityElement securityElement)
Returns token reference mode hint. |
void |
setNoNonceAndCreated()
Disables Nonce and Created subelements. |
| Methods inherited from class org.systinet.wasp.security.ws.SecurityToken |
getExternalTokenReferenceModeHint |
| Methods inherited from class org.systinet.wasp.security.ws.ReferrableElement |
getId, getIdForced, setId |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public UsernameToken(PasswordOption passwordOption)
passwordOption - password type
public UsernameToken(java.lang.String alias,
java.lang.String password,
PasswordOption passwordOption)
alias - the username element valuepasswordOption - password type| Method Detail |
public void setNoNonceAndCreated()
Nonce and Created subelements.
protected SecurityTokenConf getSecurityTokenConf(MessageConf messageConf)
getSecurityTokenConf in class SecurityTokenprotected java.lang.String getTokenReferenceModeHint(SecurityElement securityElement)
getTokenReferenceModeHint in class SecurityTokenConstants.STM_REFERENCEprotected java.lang.String getSignatureMethodHint()
getSignatureMethodHint in class SecurityTokenConstants.ALGO_ID_SIGNATURE_MAC_HMAC_SHA1protected java.lang.String getEncryptionMethodHint()
getEncryptionMethodHint in class SecurityTokenConstants.ALGO_ID_BLOCKCIPHER_TRIPLEDESprotected java.lang.String getKeyEncryptionMethodHint()
getKeyEncryptionMethodHint in class SecurityTokennull
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||