flask-security icon indicating copy to clipboard operation
flask-security copied to clipboard

OAuth Providers 2FA Redirect

Open AI-OQC opened this issue 11 months ago • 1 comments

  • After OAuth login with Google, if user has 2fa enabled, it cannot redirect to a custom component. It automatically redirects to /tf-validate, which has dated UI design. Changing 'redirect_uri' does not fix this, or SECURITY_POST_OAUTH_LOGIN_VIEW, SECURITY_POST_LOGIN_VIEW. Standard login works fine and can be redirected.
  • After entering correct authentication code, there is an error "ValueError: No valid redirect URL found - configuration error". Note again this only occurs during the OAuth route, not standard login.

AI-OQC avatar Mar 12 '24 12:03 AI-OQC

Do you have SECURITY_REDIRECT_BEHAVIOR set to "spa" - in that case - in 5.4.1 the redirect was changed to go to POST_OAUTH_LOGIN_VIEW to solve this exact problem. If REDIRECT_BEHAVIOR not set - then it goes to SECURITY_POST_LOGIN_VIEW

jwag956 avatar Mar 12 '24 14:03 jwag956