-
-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2FA changes should invalidate session (#1417)
* 2FA changes should invalidate session * User: invalidate remember me cookie if session buster increases * Fix 2FA validation on code setup
- Loading branch information
Showing
7 changed files
with
65 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace App\Entity; | ||
|
||
use Scheb\TwoFactorBundle\Model\Totp\TotpConfiguration; | ||
use Scheb\TwoFactorBundle\Model\Totp\TotpConfigurationInterface; | ||
use Scheb\TwoFactorBundle\Model\Totp\TwoFactorInterface; | ||
|
||
class TemporaryTwoFactorUser implements TwoFactorInterface | ||
{ | ||
public function __construct( | ||
private readonly User $user, | ||
private readonly string $totpSecret, | ||
) { | ||
} | ||
|
||
public function isTotpAuthenticationEnabled(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function getTotpAuthenticationUsername(): string | ||
{ | ||
return $this->user->getTotpAuthenticationUsername(); | ||
} | ||
|
||
public function getTotpAuthenticationConfiguration(): TotpConfigurationInterface | ||
{ | ||
return new TotpConfiguration($this->totpSecret, TotpConfiguration::ALGORITHM_SHA1, 30, 6); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters