Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swoole exit() triggered using Laravel Octane & Swoole #252

Open
wanadri opened this issue Oct 22, 2021 · 2 comments
Open

Swoole exit() triggered using Laravel Octane & Swoole #252

wanadri opened this issue Oct 22, 2021 · 2 comments

Comments

@wanadri
Copy link

wanadri commented Oct 22, 2021

Hi,

Laravel = 8.*
PHP = 8
Laravel Octane
Swoole

Currently, I'm facing a problem with this package if using Laravel Octane & Swoole.

During redirect to IDP URL,

swoole Exit()

will trigger because of the class that calling exit() method. To be exact, I have noticed that redirect() method in Utils.php class calling exit() method.

Below is the sample screenshot of the error response.

Screenshot 2021-10-22 at 11 09 58 AM

Kindly, need your guide/help to encounter this problem, or is there any solution that I can refer to.

Thank you.

@haught
Copy link

haught commented Feb 24, 2022

Here is what I am doing to support swoole/octane:
https://gist.github.com/haught/09f48e172ec347787b542eb03e23bd5f

You can set saml2_controller in your config to use your own instead of the bundled one.

The thing about swoole is that you don't get super globals set, so we set and unset them for onelogin/php-saml as in the above gist.

For your specific question, php-saml wants to set redirect headers and then exit - neither is going to work - so we directly use the Saml2Auth->login() method setting $stay to true. $stay is passed to Saml2Auth->redirectTo, then to OneLogin_Saml2_Utils::redirect which instead just returns the redirect url rather than setting headers and exiting.

@wanadri
Copy link
Author

wanadri commented Mar 8, 2022

Hi @haught,
Thank you for your response. Will try on your suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants