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

Missing dependency for jose.key_set.lexik_jose_bridge.signature #56

Closed
drupol opened this issue Feb 8, 2021 · 5 comments
Closed

Missing dependency for jose.key_set.lexik_jose_bridge.signature #56

drupol opened this issue Feb 8, 2021 · 5 comments
Assignees
Labels

Comments

@drupol
Copy link
Contributor

drupol commented Feb 8, 2021

Hello,

When trying to require this bundle in my app, I end up with:

Symfony operations: 17 recipes (b2d1c116c5cf892274952afbca6be32a)
  - Configuring symfony/framework-bundle (>=5.2): From github.com/symfony/recipes:master
  - Configuring symfony/security-bundle (>=5.1): From github.com/symfony/recipes:master
  - Configuring symfony/routing (>=5.1): From github.com/symfony/recipes:master
  - Configuring doctrine/annotations (>=1.0): From github.com/symfony/recipes:master
  - Configuring sensio/framework-extra-bundle (>=5.2): From github.com/symfony/recipes:master
  - Configuring lexik/jwt-authentication-bundle (>=2.5): From github.com/symfony/recipes:master
  - Configuring ecphp/api-gw-authenticator (>=dev-master): From auto-generated recipe
  - Configuring nyholm/psr7 (>=1.0): From github.com/symfony/recipes:master
  - Configuring web-token/jwt-bundle (>=v2.2.8): From auto-generated recipe
  -  WARNING  spomky-labs/lexik-jose-bridge (>=2.0): From github.com/symfony/recipes-contrib:master
    The recipe for this package comes from the "contrib" repository, which is open to community contributions.
    Review the recipe at https://github.com/symfony/recipes-contrib/tree/master/spomky-labs/lexik-jose-bridge/2.0

    Do you want to execute this recipe?
    [y] Yes
    [n] No
    [a] Yes for all packages, only for the current installation session
    [p] Yes permanently, never ask again for this project
    (defaults to n): yes
  - Configuring spomky-labs/lexik-jose-bridge (>=2.0): From github.com/symfony/recipes-contrib:master
  - Configuring symfony/console (>=5.1): From github.com/symfony/recipes:master
  - Configuring symfony/debug-bundle (>=4.1): From github.com/symfony/recipes:master
  - Configuring symfony/monolog-bundle (>=3.3): From github.com/symfony/recipes:master
  - Configuring symfony/validator (>=4.3): From github.com/symfony/recipes:master
  - Configuring symfony/twig-bundle (>=5.0): From github.com/symfony/recipes:master
  - Configuring symfony/web-profiler-bundle (>=3.3): From github.com/symfony/recipes:master
  - Configuring twig/extensions (>=1.0): From github.com/symfony/recipes:master
Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!
!!  In CheckExceptionOnInvalidReferenceBehaviorPass.php line 86:
!!
!!    The service "jose.key_set.lexik_jose_bridge.signature" has a dependency on
!!    a non-existent service "Jose\Component\KeyManagement\JKUFactory". Did you m
!!    ean this: "Jose\Component\KeyManagement\JWKFactory"?
!!
!!
!!
Script @auto-scripts was called via post-update-cmd
$
@Spomky
Copy link
Member

Spomky commented Mar 17, 2021

🤔...ok I will try to reproduce that bug and find the issue

@Spomky Spomky self-assigned this Mar 17, 2021
@Spomky
Copy link
Member

Spomky commented Mar 17, 2021

Ok I can reproduce it when

  • lexik_jose.key_set_remote parameters are set
  • jose.jku_factory is not enabled

Please make sure to install a PSR17/PSR18 library such as nyholm/psr7 and use the following configuration file config/packages/jose.yaml:

jose:
    jku_factory:
        enabled: true
        client: 'Psr\Http\Client\ClientInterface'
        request_factory: 'Psr\Http\Message\RequestFactoryInterface'

This should be fine for the default configuration but distant key set:

lexik_jose:
    ttl: 1000
    server_name: '%env(SL_JOSE_BRIDGE_SERVER_NAME)%'
    #key_set: '%env(SL_JOSE_BRIDGE_SIGNATURE_KEYSET)%'
    key_index: '93wgUTMbJm8ZN7MUTQx7xYRpifPiY7GAaAZKTZ9Y3MI'
    signature_algorithm: 'HS512'
    key_set_remote:
        type: 'jku'
        url: 'https://my.auth.server/jwks'

Side note: the documentation says HttpBundle is required, which is not the case anymore.

@Spomky Spomky added the ongoing label Mar 17, 2021
@drupol
Copy link
Contributor Author

drupol commented Mar 17, 2021

Thanks for your support @Spomky !

@luca-simonetti
Copy link

that doesn't work. It keeps saying:

Cannot instantiate interface Psr\Http\Client\ClientInterface  

@Spomky
Copy link
Member

Spomky commented Apr 22, 2021

@luca-simonetti,

It looks like you have not installed or correctly configure your Http Client.
Did you installed nyholm/psr7 or similar?

@Spomky Spomky closed this as completed Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants