code: protected Subject createBasicAuthSubject(AuthenticationData authenticationData, Subject subject) throws WSLoginFailedException, CredentialException {
          Subject basicAuthSubject = subject != null ? subject : new Subject();
  
          String loginRealm = (String) authenticationData.get(AuthenticationData.REALM);
          String username = (String) authenticationData.get(AuthenticationData.USERNAME);
          String password = getPassword((char[]) authenticationData.get(AuthenticationData.PASSWORD));
          if (username == null || username.isEmpty() || password == null || password.isEmpty()) {
              throw new WSLoginFailedException(TraceNLS.getFormattedMessage(
                                                                            this.getClass(),
                                                                            TraceConstants.MESSAGE_BUNDLE,
                                                                            "JAAS_LOGIN_MISSING_CREDENTIALS",
                                                                            new Object[] {},
                                                                            "CWWKS1171E: The login on the client application failed because the user name or password is null. Ensure the CallbackHandler implementation is gathering the necessary credentials."));
          }
          CredentialsService credentialsService = credentialsServiceRef.getServiceWithException();
          credentialsService.setBasicAuthCredential(basicAuthSubject, loginRealm, username, password);
          Principal principal = new WSPrincipal(username, null, WSPrincipal.AUTH_METHOD_BASIC);
          basicAuthSubject.getPrincipals().add(principal);
          return basicAuthSubject;
      }
docs: Create the basic auth subject using the given authentication data
  
  @param authenticationData the user, password and realm to create the subject
  @param subject the partial subject, can be null
  @return a basic auth subject that has not been authenticated yet
  @throws WSLoginFailedException if the user or password are <null> or empty
  @throws CredentialException if there was a problem creating the WSCredential