Menu

ClientWS Username Authentication

Help
Roman
2015-12-17
2015-12-28
  • Roman

    Roman - 2015-12-17

    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?

     
  • Markus Kilås

    Markus Kilås - 2015-12-28

    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/

     

Log in to post a comment.