Skip to content

Conversation

@julien-nc
Copy link
Member

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::provisionUser and set the session value (that will be used by gss master) in the controller.

@julien-nc julien-nc requested a review from juliusknorr May 20, 2025 11:59
@julien-nc julien-nc added bug Something isn't working 3. to review labels May 20, 2025
@julien-nc
Copy link
Member Author

cc @maximelehericy

@DaphneMuller
Copy link

@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 {
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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?

Copy link
Member

@juliusknorr juliusknorr left a 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

@julien-nc julien-nc force-pushed the fix/noid/gss-session-data branch from 35c0e70 to aaf0904 Compare June 4, 2025 12:06
@julien-nc
Copy link
Member Author

@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?

@julien-nc julien-nc merged commit 1d899b2 into main Jun 5, 2025
39 checks passed
@julien-nc julien-nc deleted the fix/noid/gss-session-data branch June 5, 2025 08:14
@julien-nc julien-nc mentioned this pull request Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants