flask-security
flask-security copied to clipboard
OAuth Providers 2FA Redirect
- 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.
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