scheb/two-factor-bundle

Multiple pages 2fa

jpparedesm9 opened this issue · 2 comments

Hi, I was reviewing documentation but I didn't find anything related to use 2fa for multiple pages. I mean when user tries to enter to specific page that requires a second verification when he is already logged. My idea is to ask to the user like a double check to open an specific page. That could be useful for password change or profile update. Is there any way to do that? Thanks for your help.

scheb commented

Technically, that's not two-factor authentication what you're doing.

But you can somehow do it, if you configure access_control in the security.yaml accordingly. After login, when the system asks for two-factor authentication, the user has the IS_AUTHENTICATED_2FA_IN_PROGRESS role. You can use it to give users access to some parts of the page even when they're not fully authenticated yet.

scheb commented

Closed due to inactivity. Feel free to reopen it, if the problem persists.