-
Notifications
You must be signed in to change notification settings - Fork 17
Feature: Forward Authentication Cookie #187
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
base: 1.x
Are you sure you want to change the base?
Feature: Forward Authentication Cookie #187
Conversation
StevenRenaux
commented
Sep 18, 2025
Q | A |
---|---|
Gotenberg API version ? | 8.x |
Bug fix ? | no |
New feature ? | yes |
BC break ? | no |
Issues | Fix #35 |
4f32302
to
5b4542b
Compare
5b4542b
to
d56e194
Compare
composer.json
Outdated
"symfony/http-foundation": "^6.4 || ^7.0", | ||
"symfony/http-kernel": "^6.4 || ^7.0", | ||
"symfony/mime": "^6.4 || ^7.0", | ||
"symfony/security-core": "^6.4 || ^7.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, it should not be required to generate PDFs. What about marking it optional like Twig ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to to that but because of the typing Userinterface into asUser
method (https://github.com/StevenRenaux/GotenbergBundle/blob/features/Forward-auth-cookies/src/Builder/Behaviors/Chromium/CookieTrait.php#L132) I need to get it actually
return $this; | ||
} | ||
|
||
$request->getSession()->save(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure of the impact of this call. Saving session could lead to unwanted behaviors since it's usually done at the end of the request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we not save save and close the session, we have a time out. Because Gotenberg call back our app to generate from a route or template and if the session is locked we have this time out
throw new \LogicException(\sprintf('UsernamePasswordToken is required to use "%s" method. Try to run "composer require symfony/security-bundle".', __METHOD__)); | ||
} | ||
|
||
$token = new UsernamePasswordToken($user, $firewallName, $user->getRoles()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use an Authenticator since it does additional steps on login (like user checkers).
The SecurityBundle already provides a method for allowing interactive login. If we want to only require the component, not the bundle, we could take a look to AuthenticatorManager::authenticateUser
:thinking: