code: public String getPrincipal(ContainerRequestContext httpRequest) {
          if (principalCookieName != null && httpRequest.getCookies().size() > 0) {
              Map<String, Cookie> cookies = httpRequest.getCookies();
              for (Cookie cookie : cookies.values()) {
                  if (principalCookieName.equals(cookie.getName())) {
                      return cookie.getValue();
                  }
              }
          }
  
          return null;
      }
docs: <p>getPrincipal.</p>
  
  @param httpRequest a {@link javax.ws.rs.container.ContainerRequestContext} object.
  @return a {@link java.lang.String} object.