Hello, we are transitioning from password resource owner grant type/workflow to Authorization Code Flow with Proof Key for Code Exchange (PKCE).
Currently we controlling whether users are prompted for mfa using an Auth Pipeline rule (Customize Multi-Factor Authentication Pages).
We were able to switch our single page application over to using Authorization Code Flow with Proof Key for Code Exchange (PKCE) with universal login by following the documentation with one exception, users with MFA enabled are now repeatedly asked to enter their mfa code over and over. Each time successful and each time redirecting them back to the enter MFA code screen.
Our suspicion was that our custom MFA rule is causing the re-prompting. So to test I tried adding an condition:
if (context...response_mode === 'web_message') return callback(null, user, context)
The theory being that if a user is attempting to use getAccessTokenSilently()
from the auth0-react SDK that we should not redirect them to the MFA prompt.
As far as I can tell this has made things work successfully.
My question is, is this ok from a security standpoint, and more to the point what is the correct way to handle this?