private synchronized void writeObject(final ObjectOutputStream out) throws IOException {
    final Principal thisPrincipal = principal;
    if (!isSerializable(thisPrincipal)) {
      principal = null;
    }

    final Object resolvedObj = getResolvedObj();
    NamingException namingException = null;
    if (!isSerializable(resolvedObj)) {
      namingException = (NamingException) getCause();
      namingException.setResolvedObj(null);
    }

    try {
      out.defaultWriteObject();
    } finally {
      principal = thisPrincipal;
      if (namingException != null) {
        namingException.setResolvedObj(resolvedObj);
      }
    }
  }
Returns the {@code principal} for which authorization failed.

@return the {@code principal} for which authorization failed.
geode-core/src/main/java/org/apache/geode/security/NotAuthorizedException.java