[JAX-RS] 2 ways to get the Basic auth username and password

There are 2 ways at least to get the Basic auth username and password in a JAX-RS web method 1. Using the @HeaderParam(“Authorization”) annotation [code language=”java”] @GET @Path("/usernamepwd") public String getUsernamePassword(@HeaderParam("Authorization") String header) { if (header==null) { return "header is null"; } String authorization = header.substring("Basic ".length()); byte[] decodedPass = Base64.getDecoder().decode(authorization); System.out.println("Decoded pass: " +…