Configuring HTTP Basic Authentication

PAPI Web Service can use HTTP Basic authentication to authenticate the client. The following procedures show you how to configure HTTP Basic authentication for PAPI Web Service.

To configure HTTP Basic authentication:

  1. Edit PAPI Web Service configuration and select the HTTP Basic authentication option. See Editing PAPI Web Service Configuration. The next time you start PAPI Web Service application, HTTP Basic authentication is activated.
  2. Configure your web services client to use HTTP Basic authentication when it authenticates against PAPI Web Service. The way of doing this depends on the programming language used to code your client.
    For example, for a client using Java JAX-WS stack you need to add the following method, and invoke it before executing any operation.
                                
    import java.util.Map;
    import javax.xml.ws.BindingProvider;
    
    //...
    
        private static void addHttpBasicAuthentication(PapiWebService papiWebServicePort) {
            Map<String,Object> requestContext = ((BindingProvider) papiWebServicePort).getRequestContext();
            requestContext.put(BindingProvider.USERNAME_PROPERTY, "test");
            requestContext.put(BindingProvider.PASSWORD_PROPERTY, "test");
        }
    
    //...