Building JAX-RS clients with basic authentication A normal client-server transaction can follow two scenarios of basic authentication. On one hand, a client submits a request to the server without any authentication credentials (as depicted in the previous sequence diagram). On the other hand, a client submits a request to the server with the authentication credentials. Let's take a closer look at these two scenarios. When a client submits a request without the authentication credentials, the server responds back stating unauthorized access with an HTTP error code of 401 . If the request is executed from a web browser, users see the ubiquitous Authentication Required browser popup, as shown here: Users can then supply the valid credentials to complete the request. Note that the web browser keeps track of the 401 response and is charged with sending the proper authentication credentials back with the original URI. This makes the transaction seamless for the users...
Comments
Post a Comment