No Code Attached Yet
avatar laoneo
laoneo
21 Sep 2022

Steps to reproduce the issue

  1. Enable a multifactor mehod like "Verification code" with google authenticator
  2. Set it up for your account
  3. Log in on the front end with the code and the remind me option
  4. Get a few hours later back to your sites front end

Expected result

Page loads and you are still logged in.

Actual result

You have to log in again with the code only, not the password.

Device and system info

  • What version of Joomla were you using?
    4.2.2

  • What device were you using? (eg, phone, laptop)
    Phone/PC

  • What web browser were you using? (eg, Chrome, Safari)
    Firefox

Additional comments

It is disturbing that you have to log in again on the front end when the session is still active and you want to only to browse the site. What some sites do is to require a login when some critical actions are performed like here on github when you delete a repository. For me it makes no sense to ask for another verification code, when the session is still active.

Pinging here @nikosdion, perhaps he can shed some light into this issue.

avatar laoneo laoneo - open - 21 Sep 2022
avatar joomla-cms-bot joomla-cms-bot - change - 21 Sep 2022
Labels Added: No Code Attached Yet a11y
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Sep 2022
avatar laoneo laoneo - change - 21 Sep 2022
Labels Removed: a11y
avatar laoneo laoneo - unlabeled - 21 Sep 2022
avatar nikosdion
nikosdion - comment - 21 Sep 2022

Your session at this point is NOT active. It has expired. Joomla starts with a blank session. Then the Cookie Login plugin kicks in and logs you back in with the “Remember Me” cookie, starting a new session. The session lacks a flag to indicate it's gone through MFA therefore you are asked to provide MFA.

My question is what is the setting on “Multi-factor Authentication after silent login” and what are the options in “Silent login authentication response types (for experts)”. If the former is set to No and the latter has cookie in it, it should not ask you to authenticate after cookie authentication. If that's how it's set up and it still asks you please change the issue title to “MFA always required after silent login” and assign this to me. I have seen this happening on two sites of mine and meant to investigate further but I forgot. I just want to make sure it happens on sites other than mine so I know that at the very least I am trying to solve a real core issue, not something I've messed up in my site config :)

avatar laoneo
laoneo - comment - 21 Sep 2022

Where do I find the settings “Multi-factor Authentication after silent login” and “Silent login authentication response types (for experts)”?

avatar nikosdion
nikosdion - comment - 21 Sep 2022

Users, Options, Multi-factor Authentication tab

avatar laoneo
laoneo - comment - 21 Sep 2022

"Multi-factor Authentication after silent login" is "no" and "Silent login authentication response types (for experts)" is "cookie, passwordless".

avatar laoneo laoneo - change - 21 Sep 2022
Title
Verification code is requested, even when front end session is active
MFA always required after silent login
avatar laoneo laoneo - edited - 21 Sep 2022
avatar nikosdion
nikosdion - comment - 21 Sep 2022

All right, I am on it :)

avatar laoneo
laoneo - comment - 21 Sep 2022

Turned on skype, when you need some more input.

avatar nikosdion
nikosdion - comment - 21 Sep 2022

My two sites were not working because I had not turned the option on ?

I tried reproducing your issue on a new site based on the latest 4.2-dev branch. I tried with both Remember Me (cookie authentication) and WebAuthn (passwordless authentication), with and without a login redirection. I also tried with various combinations of track session metadata. I can not reproduce the issue.

BTW: to test the cookie authentication without waiting forever it's enough to delete Joomla's session cookie, but not the Remember Me cookie, from your browser. The easiest way to do that is through the browser's dev tools. This is something I learned several years ago when I was debugging the Remember Me plugin on J3 and it still works the same way in J4.

Is it possible that your browser is actually caching the redirection to the captive page?

If you have more insight on your site's configuration please do tell me.

If you want to go through the rabbit hole, the method which handles silent logins is \PlgUserJoomla::disableMfaOnSilentLogin. Note that this is called only in the onUserAfterLogin event and only if it's the front- or backend application. If you have a plugin in your stack which cancels the onUserAfterLogin event before the Joomla user plugin's handler executes then, yeah, this feature will be broken. Try ordering the User - Joomla plugin first in the stack of user plugins and see if it makes a difference. FWIW the onUserAfterLogin event should never be cancelable but that's another architectural issue for another Joomla architecture discussion ?

avatar laoneo laoneo - change - 21 Sep 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-09-21 08:44:17
Closed_By laoneo
avatar laoneo laoneo - close - 21 Sep 2022
avatar laoneo
laoneo - comment - 21 Sep 2022

Please test #38793.

avatar laoneo
laoneo - comment - 21 Sep 2022

Found the bug. As soon as I saved the user settings, it started to work as well, because the variable is set correctly then. But it is still possible to use it with an empty string in the settings and then it breaks again.

avatar nikosdion
nikosdion - comment - 21 Sep 2022

Ah! That makes perfect sense. On my sites this was left empty because of the way I managed the settings with a custom script with the same result (which is why I thought it's just me doing something stupid with the settings).

Add a Comment

Login with GitHub to post a comment