I'm implementing OIDC authentication functionality with
- Existing common authentication server
- SPA for clients
- Resource server (My application API)
A user goes to SPA and obtains JWT token. Then SPA should call an API attaching JWT and my API should check that this JWT token was provided by the authentication server.
Technically, to validate JWT I need my API to get Public Key from authentication server, store it somewhere and be able to refresh it. It can be implemented manually, however, there should be a library to automate these actions.
In my vision a should provide a URI to issuer in config (https://{authentication server}),
then API should call {authentication server}/.well-known/openid-configuration, read path to JWKS (.well-known/openid-configuration/jwks), upload them and refresh before it is expired.
I know such libraries exist for Node (https://www.npmjs.com/package/jwks-rsa) and .NET, but could not find such for PHP, especially with integrations with Laravel and this looks strange for me.
All I've hound is only methods to parse those codes, but there is no automation
https://github.com/firebase/php-jwt#using-jwks
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…