DEV Community 👩‍💻👨‍💻

jgngo
jgngo

Posted on • Updated on

Strapi Authentication via Provider

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"
}
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Stop sifting through your feed.

Find the content you want to see.

Change your feed algorithm by adjusting your experience level and give weights to the tags you follow.