Closed MaiKaY closed 1 year ago
Hello Maik, You are not sending a valid access token as explained here. From your piece of code I assume you are sending the ID token instead of the access one.
const session = await Auth.currentSession();
jwt = session.getAccessToken().getJwtToken();
With this change, I hope everything is working fine :)
Hello Maik, I cannot reproduce this issue with a valid access token. I'm closing this as stale. Please let me know if this is resolved on your end afterwards. Thank you!
Hi Loïk,
sorry for the late response, I haven't had time the last couple of days. Thanks for the hint to use getAccessToken()
, it seems to work but with the access token I am facing now another error Request is undefined or null
. I am researching which library is causing this, I will let you know in case it's this library.
I found the issue on my end 🙈
I used AuthorizationGuard
from @nestjs-cognito/auth
within my resolver but it needs to be the AuthorizationGuard
from @nestjs-cognito/graphql
💡 (the sample
folder helped me a lot, thanks!)
Hi Loïk, do you have an idea why I am getting the
Invalid Access Token
inauth/lib/cognito/cognito.service.ts:42:13
?I am passing the JWT within
Authorization
header prefixed withBearer
to my backend system. On my frontend I am using Amplify-Auth and I am generating the token with:That never made any troubles before 🙈