diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php index bc272c90116aa5d28b5d272205941b40d3ead8c9..91588e3881f9c75610783d5c0988df72ac213571 100644 --- a/lib/SimpleSAML/Session.php +++ b/lib/SimpleSAML/Session.php @@ -518,6 +518,20 @@ class SimpleSAML_Session { public function isAuthenticated() { return $this->authenticated; } + + + /** + * Retrieve the time the user was authenticated. + * + * @return int|NULL The timestamp for when the user was authenticated. NULL if the user hasn't authenticated. + */ + public function getAuthnInstant() { + if (!$this->isAuthenticated()) { + return NULL; + } + + return $this->sessionstarted; + } // *** Attributes ***