All these methods have the following common option:
is_public: set the service public or private.
The key set configuration will look like as follow:
jose:# Configuration of the JWT Frameworkkey_sets:# Configuration of the keyskeyset_name:# Unique key namemethod_name:# Name of the method...is_public:true
The key set will be available as a container service with the ID jose.key_set.keyset_name where keyset_name is the unique name of your key set. Each key set service will be an instance of the Jose\Component\Core\JWKSet class.
As any other configuration values, you can use environment variables.
It can be interesting to share your key sets through an Url. This can easily achieved by adding a dedicated controller. This controller is automatically created by the bundle.
You can enable these routes by adding the following configuration to your routing file.
jose:key_sets:public_keyset:# The key set we want to sharejwkset: value: '{"keys":[{"kty":"OKP","crv":"X25519","x":"ovuZiVcMXBN4r0VgCvJy_ChAsBv4YPJGC5w56PzndXY"},{"kty":"OKP","crv":"X25519","x":"4qyOJ4T9RkdciIn6LDxb2LdM1Ov-dtBSuj0jh6nCuyc"}]}'
jwk_uris:shared_keyset:id:'jose.key_set.public_keyset'# The key set service to share path: '/certs' # Path of the key set. Final path is hostname/route_prefix/path: https://www.foo.com/keys/certs
Now when you go to the URL http://128.0.0.1:8000/certs, you will get your key set.
Custom Tags
You can add custom tags and attributes to the services you create.