After a user successfully authenticated using the social AzureAD login, BookStack receives Azure's login redirect (via HTTPS) but drop to HTTP when redirecting to the homepage. I could not test it using a different authentication provider but this issue should not be limited to AzureAD logins.
This issue occurs due to a faulty location header in BookStack's callback handler response.
|
return redirect()->intended('/'); |
The app URL is set to HTTPS.
Steps To Reproduce
- Start the authentication flow using the AzureAD authentication driver
- Login on the Microsoft login page
- Get redirected to BookStack
- Get redirected again to the intended page (or /)
- The connection is now no longer secured using HTTPS but is established via HTTP
Expected behavior
After the callback by AzureAD is processed, don't redirect the user to the insecure HTTP site.
Screenshots

Configuration
- BookStack Version: v0.26.2
- PHP Version: 7.something
- Hosting Method (Nginx/Apache/Docker): Docker using NGINX
After a user successfully authenticated using the social AzureAD login, BookStack receives Azure's login redirect (via HTTPS) but drop to HTTP when redirecting to the homepage. I could not test it using a different authentication provider but this issue should not be limited to AzureAD logins.
This issue occurs due to a faulty location header in BookStack's callback handler response.
BookStack/app/Auth/Access/SocialAuthService.php
Line 112 in 8fcb0e6
The app URL is set to HTTPS.
Steps To Reproduce
Expected behavior
After the callback by AzureAD is processed, don't redirect the user to the insecure HTTP site.
Screenshots

Configuration