-
Notifications
You must be signed in to change notification settings - Fork 44
Set the gss session data in the controller rather than in the service #1123
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
Conversation
|
@juliusknorr any chance you can give this a review? |
| * @throws PreConditionNotMetException | ||
| */ | ||
| public function provisionUser(string $tokenUserId, int $providerId, object $idTokenPayload, ?IUser $existingLocalUser = null): ?IUser { | ||
| public function provisionUser(string $tokenUserId, int $providerId, object $idTokenPayload, ?IUser $existingLocalUser = null): array { |
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.
Not a fan of using arrays that way, but can we annotate the type of the array so psalm can analyze it at least?
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.
Thanks, done. I can't predict what's gonna be in userData so I keep a simple array type. All good?
Not a fan of using arrays that way
I agree it's not great. The alternative would be to pass the ISession object from the LoginController to provisioningService->provisionUser() to be able to change the session in there. Not elegant either.
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 can also create a ProvisioningResult class that contains the user and the raw user data. It's a bit cleaner. Wdyt?
juliusknorr
left a comment
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.
Code wise this makes sense but I have no way to test this
…he service Signed-off-by: Julien Veyssier <[email protected]>
35c0e70 to
aaf0904
Compare
|
@juliusknorr By the way, any idea why it does not work anymore to store things in the session with an ISession object injected in a service? I'm pretty sure it worked before. Anything changed in the server? |
I don't even know how it worked when setting it in the provisioning service.
The logic is now to return the user data from
ProvisioningService::provisionUserand set the session value (that will be used by gss master) in the controller.