Skip to content

Skip intermediate login page with single provider - #3406

Merged
ssddanbrown merged 1 commit into
BookStackApp:developmentfrom
rjmidau:login-auto-redirect
Jun 21, 2022
Merged

ssddanbrown merged 1 commit into
BookStackApp:developmentfrom
rjmidau:login-auto-redirect

Conversation

@rjmidau

@rjmidau rjmidau commented May 2, 2022

Copy link
Copy Markdown

Resolves #3216, #2175

When a single authentication provider is configured, it is now possible to skip the intermediate user interaction on the /login page and redirect directly to the auth provider's actual login page, saving an extra click for users.
This new behaviour is disabled by default, and can be enabled by setting the AUTH_AUTO_REDIRECT environment variable to true.

This new behaviour only works for saml2 and oidc providers, and will not work if Social Auth providers are enabled.
This new behaviour will not be honoured for /login if argument ?logout=1 is passed (which is where users are redirected to after logout when AUTH_AUTO_REDIRECT is set to true).

This also introduces an overridden logout() function so post-logout redirection can be honoured (it appears redirectAfterLogout has not been honoured in Laravel since ~5.3 - see laravel/framework#15525)

@isurinda

isurinda commented May 4, 2022

Copy link
Copy Markdown

I have applied these changes and can confirm that its working in version 22.02.3

@mvicomoya

Copy link
Copy Markdown

I have applied these changes and can confirm that its working in version 22.02.3

+1

I tried these on top of 22.04.2 and work as expected.

@ssddanbrown ssddanbrown added this to the Next Feature Release milestone Jun 21, 2022
ssddanbrown added a commit that referenced this pull request Jun 21, 2022
For PR #3406

- Updated naming from 'redirect' to 'initate/initation'.
- Updated phpunit.xml and .env.example.complete files with the new
  option.
- Cleaned up controller logic a bit.
- Added content and design to the new initation view to not leave user
  on a blank view for a while.
- Added non-JS button to initiation view as fallback option for
  progression.
- Moved new test to it's own Test class and expanded with additional
  scenario tests for better functionality coverage.
@ssddanbrown
ssddanbrown merged commit d5ce6b6 into BookStackApp:development Jun 21, 2022
@ssddanbrown

Copy link
Copy Markdown
Member

Thank you very much for this @rjmidau. All looked good.
I have now merged this for next feature release.

I did follow this up with a set of changes in 8b211ed. These were primarily naming changes in addition to expanding tests and making the new intermediate view an actual view with content & loading animation, with a manual-non-js option to trigger the authentication form submission as a backup.

@rjmidau
rjmidau deleted the login-auto-redirect branch June 22, 2022 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Skip intermediate login page with single provider

4 participants