- just added a jwt validation middleware using
app.use()as shown in Setting Up Authentication and Authorization with Apollo Federation - Apollo Blog
- after adding this middleware i am unable to access graphql playground on the usual endpoint
- is this a known issue? does it have a solution?
- need playground in dev environment so that developers can integrate APIs faster, need to secure it so that it is not open on the public internet
What version of Apollo Server are you using? We changed a lot about how playground (or alternate landing pages) are integrated in AS3.
Sharing a reproduction (eg a repo we can clone) would help a lot too!
Hello! I’m not well versed in the ways of jwt, but a potential coarse-grained solution is to not
checkJwt middleware in local development environments by setting and subsequently checking
NODE_ENV in each environment the gateway is running in.
It looks like successfully running this reproduction requires me to set a bunch of environment variables like SERVICE_1_ENDPOINT. Can you update the reproduction so it doesn’t require any creativity on my part? (If you can focus entirely on Apollo Server and remove Apollo Gateway entirely, that would help.)
Additionally, this reproduction uses Apollo Server 2. We’ve completely reworked how Playground (or alternative landing pages) integrates with Apollo Server in Apollo Server 3. Can you try upgrading to Apollo Server 3? We’re currently only supporting Apollo Server 2 for security releases.