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

SSP-2030_OIDC_module_switch_to_ProcessingChain_for_authproc_support_consent_mod #228

Conversation

ioigoume
Copy link

@ioigoume ioigoume commented Jun 11, 2024

@ioigoume ioigoume marked this pull request as draft June 11, 2024 17:39
@ioigoume
Copy link
Author

@cicnavi
the last commit on the wip-version-6 branch broke the dependencies injected from the modules/oidc/src/Services/Container.php class.

@cicnavi
Copy link
Collaborator

cicnavi commented Jun 11, 2024

@cicnavi the last commit on the wip-version-6 branch broke the dependencies injected from the modules/oidc/src/Services/Container.php class.

What exactly, how should I reproduce this?

@ioigoume
Copy link
Author

@cicnavi ,
before the commit that changed the routes this is how the authorize flow worked:

  • public/authorize.php
  • RoutingService initialized the ContainerService and created and injected all the dependencies to all the other services
  • Called the controller

After the change the module uses the Symfony routing service. As a result, the old ContainerService is never called and the dependencies are not created/injected in the controller as before. For example the $requestRuleManager dependency is null.

In order to reproduce I am running the authorization flow.

@cicnavi
Copy link
Collaborator

cicnavi commented Jun 12, 2024

Well yes, we are moving to Symfony routes and container. In v6, I was thinking to have both Symfony routes and "old" public/*.php routes available. The reason for both routes is that some RPs will have "old" configuration fetched from the configuration endpoint, and in this way they will still be able to authenticate using old routes and have time to fetch new configuration with new endpoints.

So, it's important that the old routes still function if they are used. I thought that I messed something up with them, but if I understand correctly, the problem for you now is that they are not used by default any more.

So, yes, if you are going to implement new stuff, please use Symfony routes and container... this is how SSP now handles requests, and we are actually pretty late to implement this...

@cicnavi
Copy link
Collaborator

cicnavi commented Jun 12, 2024

Oh, and if I can help in any way, please let me now. Feel free to ping me on Slack (join group SimpleSAMLphp if you haven't already).

@ioigoume ioigoume marked this pull request as ready for review June 17, 2024 10:46
@ioigoume
Copy link
Author

@cicnavi can you please provide some feedback on this PR. I refactored the existing tests so that they run correctly. As soon as we have a consensus about the new code I will extend the tests.

@cicnavi
Copy link
Collaborator

cicnavi commented Jun 18, 2024 via email

Copy link
Collaborator

@pradtke pradtke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks pretty good. I'd like to remove the redirect that happens from calling ProcessingChain::resumeProcessing($state);

I think for tests, I think you need one for AuthorizationControllerTest that invokes the code path that calls authenticationService->processRequest and a test in AuthenticationServiceTest to test processRequest

src/Controller/AuthorizationController.php Outdated Show resolved Hide resolved
src/Services/AuthenticationService.php Outdated Show resolved Hide resolved
src/Services/AuthenticationService.php Show resolved Hide resolved
src/Services/AuthenticationService.php Outdated Show resolved Hide resolved
src/Services/AuthenticationService.php Outdated Show resolved Hide resolved
src/Utils/Checker/Rules/MaxAgeRule.php Show resolved Hide resolved
@cicnavi
Copy link
Collaborator

cicnavi commented Jun 23, 2024

There are some conformance test issues, but are not visible here since no action runs were started. @tvdijen what is the policy on running actions in PRs?

…essingChain_for_authproc_support_consent_mod
@cicnavi
Copy link
Collaborator

cicnavi commented Jun 23, 2024

@ioigoume You can also try to run conformance tests locally as per https://github.com/simplesamlphp/simplesamlphp-module-oidc/blob/wip-version-6/CONFORMANCE_TEST.md

@tvdijen
Copy link
Member

tvdijen commented Jun 24, 2024

[..] @tvdijen what is the policy on running actions in PRs?

We do this on any other repository, but this repo's test-suite has diverged over the years and I stopped keeping it in sync

Copy link
Collaborator

@pradtke pradtke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also still need tests.

src/Services/AuthenticationService.php Outdated Show resolved Hide resolved
src/Entities/AccessTokenEntity.php Outdated Show resolved Hide resolved
@cicnavi
Copy link
Collaborator

cicnavi commented Jun 24, 2024

[..] @tvdijen what is the policy on running actions in PRs?

We do this on any other repository, but this repo's test-suite has diverged over the years and I stopped keeping it in sync

I don't follow. When I do a pull request, actions do run. Why they didn't run for ioigoumes PR?

@tvdijen
Copy link
Member

tvdijen commented Jun 24, 2024

I don't follow. When I do a pull request, actions do run. Why they didn't run for ioigoumes PR?

Ah! Because they only run against master or branches called release-*..

https://github.com/simplesamlphp/simplesamlphp-module-oidc/blob/master/.github/workflows/test.yaml#L7

We could add bugfix/* and feature/* but it will require some discipline to keep the naming-convention

Copy link
Collaborator

@pradtke pradtke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is the line about $authState being a string that I don't understand.

I also don't see a test for AuthorizationControllerTest that results in $this->authenticationService->processRequest being called.

Thanks

src/Services/AuthenticationService.php Outdated Show resolved Hide resolved
@ioigoume ioigoume requested review from cicnavi and pradtke July 5, 2024 14:45
@pradtke
Copy link
Collaborator

pradtke commented Jul 10, 2024

I did some more local testing with the authprocs and things worked as I expected.
I made a minor commit to add some info on running a docker image with preprodwarning authproc enabled to test redirects, and I enabled one basic authproc for the conformance tests (just to confirm that invoking authproc doesn't make anything explode, there is no validation of what the authproc does in the conformance test)

@cicnavi I'm ready to merge this. If you agree then I can do a squash and merge. Thanks

@cicnavi
Copy link
Collaborator

cicnavi commented Jul 11, 2024 via email

@pradtke
Copy link
Collaborator

pradtke commented Jul 11, 2024

Good call out on the documentation. I updated it to reflect that we can now support doing redirects in the authproc.
The ProcessinChain does try to load additional authproc filters from the main config.php but it will be looking for them under the key authproc.oidc rather than authproc.idp that saml uses. I made a note of that behavior changes in the upgrade notes incase someone, for some unknown reason, has that key already defined.

@pradtke pradtke merged commit 2f15487 into simplesamlphp:wip-version-6 Jul 11, 2024
8 checks passed
@cicnavi
Copy link
Collaborator

cicnavi commented Jul 12, 2024 via email

@ioigoume ioigoume deleted the SSP-2030_OIDC_module_switch_to_ProcessingChain_for_authproc_support_consent_mod branch July 12, 2024 06:40
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

Successfully merging this pull request may close these issues.

4 participants