Description
Describe the bug
When using Orchard Core with a single external identity provider configured for login and the option "Use external provider for login" enabled in the admin settings, the login screen intermittently displays a choice between the external provider and the standard username/password login. It is expected that the system should automatically redirect to the external provider for authentication without showing the login screen.
Orchard Core version
2.1.2
To Reproduce
- Go to Settings > External Login in the Orchard Core admin dashboard.
- Enable the "Use external provider for login" checkbox.
- Ensure only one external provider is configured (e.g., Github).
- Access the login page repeatedly using the same URL (e.g.,
https://localhost:5001/admin
).
Expected behavior
The login screen should consistently redirect to the external provider for authentication without presenting the choice between username/password login and the external provider.
Actual behavior
The behavior is inconsistent and alternates between the following:
- On the first page load, it redirects to the external provider as expected.
- On subsequent page loads (odd vs. even attempts), the login screen displays a choice between the external provider and the standard login.
For example:
- First load of
https://localhost:5001/admin
works and redirects. - Second load shows the login screen with options.
- Subsequent attempts alternate between the two behaviors.
Logs and screenshots
Settings Configuration:
Login Screen:
Steps to Mitigate/Workaround
No workaround identified.
Suggested Fix
Update the logic in the login flow to ensure consistent behavior when the "Use external provider for login" option is enabled, particularly when only one external provider is configured. The system should always redirect to the external provider without showing the login screen.
References
N/A