Closed all9lives closed 2 years ago
Does a protected graphql endpoint work otherwise and it's only the playground where you have issues?
@thisismydesign thanks for your response.
I've also tried with Postman and get the same 401 Unauthorized
response.
I'm just using your starter repo, with Cognito config added to the env file.
I was able to get authorization to work actually. It looks like in PR #29 you're no longer extracting the JWT from the AuthHeader.
So by checking for Auth Header and extracting the JWT in JwtAuthStrategy
it works like a charm.
Cool, thanks! If you think the readme could be improved to reflect this, I'm happy to accept a pr.
@all9lives This turned out to be a simple configuration option as explained here: https://stackoverflow.com/a/68164992/2771889
I enabled it by default: https://github.com/thisismydesign/nestjs-starter/pull/76
Thanks for creating this repo, it's a great starting off point.
I was able to get everything working with Cognito hosted auth pages, and I can access
/private
and/profile
endpoints without issue. But when I try to load the protected graphql operations, in the playground I get an unauthorized error, even when I added the Bearer authorization header.Any tricks for this? I'm just getting the JWT from the session cooking.
Here is the response.
Appreciate any insights you have 🙏🏼