laravel-saml2 icon indicating copy to clipboard operation
laravel-saml2 copied to clipboard

How to handle RequestDenied responses correctly?

Open Restingo opened this issue 3 years ago • 0 comments

Currently if I'm trying to sign in a user that has no permission to the application signing in to, if got an error 500:

[2022-11-29 13:57:14] staging.ERROR: saml2.error_detail {"error":"The status code of the Response was not Success, was Responder -> urn:oasis:names:tc:SAML:2.0:status:RequestDenied"}
[2022-11-29 13:57:14] staging.ERROR: saml2.error ["invalid_response"]
[2022-11-29 13:57:14] staging.ERROR: Symfony\Component\HttpFoundation\Response::setContent(): Argument #1 ($content) must be of type ?string, Illuminate\Routing\Redirector given, called in .../vendor/laravel/framework/src/Illuminate/Http/Response.php on line 72 {"exception":"[object] (TypeError(code: 0): Symfony\\Component\\HttpFoundation\\Response::setContent(): Argument #1 ($content) must be of type ?string, Illuminate\\Routing\\Redirector given, called in .../vendor/laravel/framework/src/Illuminate/Http/Response.php on line 72 at .../vendor/symfony/http-foundation/Response.php:412)

I am handling the login of the user in an Event listener. Where can I catch the exception and handle it correctly?

Restingo avatar Nov 29 '22 13:11 Restingo