1
votes

So I have an Api Platform application with JWT authentication using LexikJWTAuthenticatorBundle. So my users already have a JWT used to authenticate. Can I somehow use this same JWT to authenticate them for private updates on the Mercure hub?

I am not sure how to configure Mercure to use the private/public keys that are using by Lexik:

mercure:
                image: dunglas/mercure
                environment:
                    - ALLOW_ANONYMOUS=1
                    - CORS_ALLOWED_ORIGINS=http://localhost:8080
                    - DEMO=1
                    - JWT_KEY=???
                    - JWT_ALGORITHM=RS256
                    - PUBLISH_ALLOWED_ORIGINS=http://localhost:180
1

1 Answers

0
votes

you can do that JWT_KEY=`cat filename.pub`: https://mercure.rocks/docs/hub/config for windows it's works, for cent os - i have some error with key reading ((