Logging management
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.core / src / main / java / org / argeo / security / OsAuthenticationToken.java
index 61ec539c610f08290ae093b423f8eb000ad735c6..8ba3f9fbca9dad3f8d74f6398a216e63b43f5414 100644 (file)
@@ -71,7 +71,11 @@ public class OsAuthenticationToken implements Authentication {
                this(null);
        }
 
+       /** @return the name, or null if not yet logged */
        public String getName() {
+               Subject subject = Subject.getSubject(AccessController.getContext());
+               if (subject == null)
+                       return null;
                return getUser().getName();
        }