Uncaught PHP Exception Symfony\\Component\\Routing\\Exception\\MissingMandatoryParametersException

Created on 5 January 2023, about 2 years ago
Updated 15 March 2023, almost 2 years ago

I have upgraded a D9 Instance to D 10.0.0. Therefore i needed this module in Version 2.2.0-beta5.

I got error messages about incompatible Interfaces:

Fatal error: Declaration of Drupal\keycloak\Plugin\OpenIDConnectClient\Keycloak::defaultConfiguration() must be compatible with Drupal\openid_connect\Plugin\OpenIDConnectClientBase::defaultConfiguration(): array in /var/www/html/web/modules/contrib/keycloak/src/Plugin/OpenIDConnectClient/Keycloak.php on line 59

The error shows on accessing the "/admin/config/people/openid-connect/add/keycloak" route or by clicking the "login with keycloak"-button.

The attached patch "fixes" these error messages.

I am now stuck on the next error message:

Symfony\Component\Routing\Exception\MissingMandatoryParametersException: Some mandatory parameters are missing ("openid_connect_client") to generate a URL for route "openid_connect.redirect_controller_redirect". in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 181 of core/lib/Drupal/Core/Routing/UrlGenerator.php).

There seems to be more to fix, but i think this is properly out of my scope.

πŸ› Bug report
Status

Fixed

Version

2.2

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany LudwigJP

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Closed: duplicate almost 2 years ago
  • πŸ‡§πŸ‡ͺBelgium BramDriesen Belgium πŸ‡§πŸ‡ͺ

    Sorry I missed your patch. I fixed the same things as you did as well as some other things here πŸ› Error 500 when adding Keycloak Open ID Fixed

    Still looking into other deprecations that I have spotted and the second error you posted.

    Setting this issue as duplicate, but I will credit you on the other issue so you get a credit for your work!

  • πŸ‡ΊπŸ‡ΈUnited States jerrac

    I just installed 2.2.0-beta7 this evening. After configuring Keycloak and this module, I get the "Some mandatory parameters are missing..." error when I try to log in via Keycloak.

    [Wed Mar 15 03:35:30.491499 2023] [php:notice] [pid 480] [client 172.21.0.1:0] Uncaught PHP Exception Symfony\\Component\\Routing\\Exception\\MissingMandatoryParametersException: "Some mandatory parameters are missing ("openid_connect_client") to generate a URL for route "openid_connect.redirect_controller_redirect"." at /var/www/html/web/core/lib/Drupal/Core/Routing/UrlGenerator.php line 181, referer: https://testsite/user/login
    

    I'm running in a PHP 8.1 container. Drupal 9.5.4. Installed via Composer.

  • Status changed to Active almost 2 years ago
  • πŸ‡§πŸ‡ͺBelgium BramDriesen Belgium πŸ‡§πŸ‡ͺ
  • Status changed to Fixed almost 2 years ago
  • πŸ‡§πŸ‡ͺBelgium BramDriesen Belgium πŸ‡§πŸ‡ͺ

    Pretty sure I fixed that but didn't push before my gitpod expired/closed.
    Can you try again on https://www.drupal.org/project/keycloak/releases/2.2.0-beta8 β†’

  • Status changed to Closed: duplicate almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States jerrac

    Yeah, I did think you had fixed it from what I was reading.

    I think I'm hitting a different error now. I don't think it's a misconfiguration on my end, but...

    [Wed Mar 15 13:09:47.895233 2023] [php:notice] [pid 598] [client 172.21.0.1:0] Uncaught PHP Exception InvalidArgumentException: "The URI '/realms//protocol/openid-connect/auth' is invalid. You must use a valid URI scheme." at /var/www/html/web/core/lib/Drupal/Core/Url.php line 293, referer: https://testsite/user/login
    172.20.0.3 - - - [15/Mar/2023:13:09:47 +0000] "POST /user/login HTTP/1.1" 500 68 "https://testsite/user/login" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0"
    

    I put the base url for my Keycloak in the Keycloak base URL field. I tried both with, and without, /auth. Keycloak realm is set correctly. And the client id matches what I have in Keycloak.

    Let me know if this should be a new issue.

  • Status changed to Fixed almost 2 years ago
  • πŸ‡§πŸ‡ͺBelgium BramDriesen Belgium πŸ‡§πŸ‡ͺ

    I will test tonight since the OpenID structure changed in 3.0

    Will create follow up issues if needed.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024