I am testing client web services in order to call signers remotely through my client.
With authentication type NOAUTH, every request sent through processData method is processed.
Now I changed authenticaton to org.signserver.server.UsernameAuthorizer and I am sending username through metadata. I am sending a pair "CLIENT_CREDENTIAL" and "testusername" in metadata.
But I am always getting back "Username required".
How to send username information to worker through ClientWS? I assume it should be i metadata but I don't know what should be the format. Is it somewhere documented?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The username/password authentication is done using HTTP Basic Auth and is thus added as HTTP headers when posting the web services request. Using Java (JAX-WS) something like this (see ClientWSDocumentSigner.java for example) can be used:
ClientWSService service = new ClientWSService(new URL(url), new QName("http://clientws.signserver.org/", "ClientWSService"));
((BindingProvider) signServer).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, username);
((BindingProvider) signServer).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
I am testing client web services in order to call signers remotely through my client.
With authentication type NOAUTH, every request sent through processData method is processed.
Now I changed authenticaton to org.signserver.server.UsernameAuthorizer and I am sending username through metadata. I am sending a pair "CLIENT_CREDENTIAL" and "testusername" in metadata.
But I am always getting back "Username required".
How to send username information to worker through ClientWS? I assume it should be i metadata but I don't know what should be the format. Is it somewhere documented?
Hi Roman,
The username/password authentication is done using HTTP Basic Auth and is thus added as HTTP headers when posting the web services request. Using Java (JAX-WS) something like this (see ClientWSDocumentSigner.java for example) can be used:
ClientWSService service = new ClientWSService(new URL(url), new QName("http://clientws.signserver.org/", "ClientWSService"));
((BindingProvider) signServer).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, username);
((BindingProvider) signServer).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
Regards,
Markus
PrimeKey Solutions
Save time and money with an Enterprise support subscription. Please see www.primekey.se for more information.
https://www.primekey.se/technologies/products-overview/
https://www.primekey.se/service-support/support/