1

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
4

1 回答 1

0

你可以这样做 JWT_KEY=`cat filename.pub`: https://mercure.rocks/docs/hub/config 对于 windows 它是有效的,对于 cent os - 我在读取密钥时遇到了一些错误((

于 2020-08-03T14:35:23.043 回答