File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,13 +104,13 @@ will be forced into 2FA.
104104 *
105105 * This new option makes the behaviour configurable.
106106 *
107- * If set to null (default) or unset, the old behaviour is maintained.
107+ * If set to any negative number or unset, the old behaviour is maintained.
108108 *
109109 * If set to an amount of seconds (i.e. integer value), second-factor auth
110110 * is requested only on initial authentication and if the last second-factor
111111 * was more than this amount of seconds ago.
112112 */
113- // 'secondfactormaxage' => NULL ,
113+ // 'secondfactormaxage' => -1 ,
114114],
115115```
116116
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ public function __construct(array $config, $reserved) {
8787 $ this ->useDatabase = $ config ['use_database ' ] ?? true ;
8888 $ this ->defaultEnabled = $ config ['default_enable ' ] ?? false ;
8989 $ this ->authnContextClassRef = $ config ['authncontextclassref ' ] ?? null ;
90- $ this ->SecondFactorMaxAge = $ config ['secondfactormaxage ' ] ?? null ;
90+ $ this ->SecondFactorMaxAge = $ config ['secondfactormaxage ' ] ?? - 1 ;
9191
9292 if (array_key_exists ('use_inflow_registration ' , $ moduleConfig ['registration ' ])) {
9393 $ this ->stateData ->useInflowRegistration = $ moduleConfig ['registration ' ]['use_inflow_registration ' ];
@@ -146,7 +146,7 @@ public function process(array &$state): void {
146146 if // do we need to do secondFactor in interval, or even every time?
147147 // we skip only if an interval is configured AND we did successfully authenticate, AND are within the interval
148148 (
149- $ this ->SecondFactorMaxAge !== null && //
149+ $ this ->SecondFactorMaxAge >= 0 && //
150150 (
151151 isset ($ state ['Attributes ' ]['LastSuccessfulSecondFactor ' ]) &&
152152 $ state ['Attributes ' ]['LastSuccessfulSecondFactor ' ] instanceof \DateTime
You can’t perform that action at this time.
0 commit comments