code: @Override
      public void setBasicAuthCredential(Subject basicAuthSubject, String realm, String username, @Sensitive String password) throws CredentialException {
          CredentialProvider provider = basicAuthCredentialProvider.getService();
          if (provider != null) {
              Hashtable<String, Object> hashtable = new Hashtable<String, Object>();
              hashtable.put(KEY_BASIC_AUTH_REALM, realm);
              hashtable.put(KEY_BASIC_AUTH_USER, username);
              hashtable.put(KEY_BASIC_AUTH_PASSWORD, new SerializableProtectedString(password.toCharArray()));
              basicAuthSubject.getPrivateCredentials().add(hashtable);
  
              provider.setCredential(basicAuthSubject);
          }
      }
docs: {@inheritDoc}