Code: Select all
...
Ich habe STSClient wie folgt konfiguriert:
Code: Select all
@Test
void stsTest() throws Exception {
var stsClient = new STSClient(bus);
stsClient.setWsdlLocation("classpath:STS.wsdl");
stsClient.setServiceQName(new QName(NAMESPACE, STS_SERVICE_NAME));
stsClient.setEndpointQName(new QName(NAMESPACE, STS_ENDPOINT_NAME));
stsClient.setSendRenewing(false);
stsClient.setSendKeyType(false);
var crypto = new Merlin();
crypto.setKeyStore(createInMemoryKeyStore());
stsClient.getProperties().put(SecurityConstants.SIGNATURE_USERNAME, "username");
stsClient.getProperties().put(SecurityConstants.SIGNATURE_CRYPTO, crypto);
stsClient.getProperties().put(SecurityConstants.CALLBACK_HANDLER, (CallbackHandler) callbacks -> {
for (Callback callback : callbacks) {
if (callback instanceof WSPasswordCallback) {
WSPasswordCallback pc = (WSPasswordCallback) callback;
pc.setPassword("password123");
}
}
});
stsClient.getOutInterceptors().add(createLoggingOutInterceptor());
stsClient.requestSecurityToken();
}
Code: Select all
org.apache.cxf.interceptor.Fault: No username available
Ist es möglich, STSClient irgendwie für die Verwendung von X509Token zu konfigurieren? Wenn ich UsernameToken aus SupportedTokens lösche, funktioniert alles einwandfrei, aber ich möchte die WSDL nicht ändern, da diese nicht meine ist.
Mobile version