If you use a 3rd party provider in Strapi for authentication, the access token works a little differently.
The access token that you receive from cognito is not valid in Strapi. You need to retrieve a token from strapi.
From the frontend app, you will need to read the query string from cognito after successful authentication and submit it again to Strapi so that the user and another access token is returned.
${backendUrl}/api/auth/${params.providerName}/callback
{
"jwt": "<access token> that you can use thereafter",
"user": {
"id": 1,
"username": "google_999999999999999999",
"email": "theuser@gmail.com",
"provider": "cognito",
"confirmed": true,
"blocked": false,
"createdAt": "2022-05-30T02:50:08.907Z",
"updatedAt": "2022-05-30T02:50:08.907Z"
}
}
Top comments (0)