Azure AD auth Firefox Only Error #1887

Closed
opened 2026-02-05 02:07:35 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @mvilche on GitHub (Oct 6, 2020).

Hi.

I have correctly configured and working the integration with Azure AD. Everything works fine in chrome and edge but in firefox when you try to login it returns to login.
In the log laravel.log I see the following when I log in with firefox only:

[2020-10-05 21:31:47] production.ERROR: Acción no definida {"exception":"[object] (BookStack\Exceptions\SocialSignInException(code: 0): Acción no definida at /var/www/html/app/Http/Controllers/Auth/SocialController.php:66)
[stacktrace]
#0 [internal function]: BookStack\Http\Controllers\Auth\SocialController->socialCallback(Object(BookStack\Http\Request), 'azure')
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('socialCallback', Array)
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(BookStack\Http\Controllers\Auth\SocialController), 'socialCallback')
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\Routing\Route->runController()
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(681): Illuminate\Routing\Route->run()
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(BookStack\Http\Request))
#7 /var/www/html/app/Http/Middleware/GlobalViewData.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): BookStack\Http\Middleware\GlobalViewData->handle(Object(BookStack\Http\Request), Object(Closure))
#9 /var/www/html/app/Http/Middleware/Localization.php(77): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(BookStack\Http\Request))

Originally created by @mvilche on GitHub (Oct 6, 2020). Hi. I have correctly configured and working the integration with Azure AD. Everything works fine in chrome and edge but in firefox when you try to login it returns to login. In the log laravel.log I see the following when I log in with firefox only: [2020-10-05 21:31:47] production.ERROR: Acción no definida {"exception":"[object] (BookStack\\Exceptions\\SocialSignInException(code: 0): Acción no definida at /var/www/html/app/Http/Controllers/Auth/SocialController.php:66) [stacktrace] #0 [internal function]: BookStack\\Http\\Controllers\\Auth\\SocialController->socialCallback(Object(BookStack\\Http\\Request), 'azure') #1 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array) #2 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('socialCallback', Array) #3 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(BookStack\\Http\\Controllers\\Auth\\SocialController), 'socialCallback') #4 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\\Routing\\Route->runController() #5 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(681): Illuminate\\Routing\\Route->run() #6 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(BookStack\\Http\\Request)) #7 /var/www/html/app/Http/Middleware/GlobalViewData.php(25): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(BookStack\\Http\\Request)) #8 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): BookStack\\Http\\Middleware\\GlobalViewData->handle(Object(BookStack\\Http\\Request), Object(Closure)) #9 /var/www/html/app/Http/Middleware/Localization.php(77): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(BookStack\\Http\\Request))
Author
Owner

@ssddanbrown commented on GitHub (Oct 6, 2020):

Hi @mvilche,
Sorry to hear you are having issues.

That's an odd problem to have in just a certain browser.
That error appears if a certain "callback action" is not found in the user's session. The session relies on the use of cookies which is where browser differences could affect things.

Here's my two best guesses as to why this might be:

  • You're accessing via a different host in Firefox? This includes the HTTP/HTTPS part. If you start the login process on http then get redirected to https (Or vice verca) then that could count as a new session and then loose that "callback action".
  • Browser plugins or features are stopping the cookies being set consistently. Anything that could affect cookies being set (Privacy plugins) or auto-direct URLs could have an impact. You could try starting in safe mode.
@ssddanbrown commented on GitHub (Oct 6, 2020): Hi @mvilche, Sorry to hear you are having issues. That's an odd problem to have in just a certain browser. That error appears if a certain "callback action" is not found in the user's session. The session relies on the use of cookies which is where browser differences could affect things. Here's my two best guesses as to why this might be: - You're accessing via a different host in Firefox? This includes the HTTP/HTTPS part. If you start the login process on http then get redirected to https (Or vice verca) then that could count as a new session and then loose that "callback action". - Browser plugins or features are stopping the cookies being set consistently. Anything that could affect cookies being set (Privacy plugins) or auto-direct URLs could have an impact. You could [try starting in safe mode](https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode).
Author
Owner

@mvilche commented on GitHub (Oct 13, 2020):

Hi.

Thanks for the reply and the excellent software.

I've been trying multiple options in firefox but it still doesn't work.
The options that you comment check all and all are correct.

I do not realize why it does not work in firefox.
This happens to me on various devices.
Weird chrome and edge work fine.

@mvilche commented on GitHub (Oct 13, 2020): Hi. Thanks for the reply and the excellent software. I've been trying multiple options in firefox but it still doesn't work. The options that you comment check all and all are correct. I do not realize why it does not work in firefox. This happens to me on various devices. Weird chrome and edge work fine.
Author
Owner

@ssddanbrown commented on GitHub (Jan 26, 2021):

One thing to check here, This could be caused by something in firefox forcing a cookie's "SameSite" value to be strict.

This could also be more of an issue if you're loading BookStack through an iframe, since browsers have recently started treating those scenarios more strictly. In the latest release, We have added options for iframe support but it needs to be configured. Also, The latest releases changes how cookies are set by default which could allow things to work better.

@ssddanbrown commented on GitHub (Jan 26, 2021): One thing to check here, This could be caused by something in firefox forcing a cookie's "SameSite" value to be strict. This could also be more of an issue if you're loading BookStack through an iframe, since browsers have recently started treating those scenarios more strictly. In the latest release, We have added options for iframe support but it needs to be configured. Also, The latest releases changes how cookies are set by default which could allow things to work better.
Author
Owner

@mvilche commented on GitHub (Jan 27, 2021):

Hi.

Fix with force header cookie with value Lax.

Thanks!

@mvilche commented on GitHub (Jan 27, 2021): Hi. Fix with force header cookie with value Lax. Thanks!
Author
Owner

@ssddanbrown commented on GitHub (Jan 28, 2021):

Awesome! Will therefore close this.

@ssddanbrown commented on GitHub (Jan 28, 2021): Awesome! Will therefore close this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1887