GoogleAuth helps users to easily make google authentication available for their website users. It uses the official google-auth library to execute the actions. A user can get it working in under 2 minutes in their Strapi application using this plugin. EASY!
GoogleAuth helps you to easily create google authentication available for your users. It uses the official google-auth library to execute the actions. You can get it working in under 2 minutes in your application. EASY!
Add the folling lines of code in the file: config/plugins.js
1module.exports = {
2 "strapi-google-auth": {
3 enabled: true,
4 },
5};
1 {
2 method: 'GET',
3 path: 'STRAPI_BACKEND_URL/strapi-google-auth/init',
4 }
After google login, it will redirect the user back to the redirect URL mentioned in the Google project console, with a code parameter in the URL. https://REDIRECT_URL?code=REDIRECTION_AUTH_CODE
Use the REDIRECTION_AUTH_CODE you have recieved from the step 1 to make the second request to authenticate the user.
1 {
2 method: 'POST',
3 path: 'STRAPI_BACKEND_URL/strapi-google-auth/user-profile',
4 data: {
5 code:REDIRECTION_AUTH_CODE
6 }
7 }
Use the JWT token to fetch the user details.
1 {
2 method: 'GET',
3 path: 'STRAPI_BACKEND_URL/strapi-google-auth/me',
4 header: {
5 authorization:Bearer <TOKEN>
6 }
7 }
Use the JWT token to fetch the user details.
1 {
2 method: 'POST',
3 path: 'STRAPI_BACKEND_URL/strapi-google-auth/update-password',
4 header: {
5 authorization:Bearer <TOKEN>
6 },
7 data:{
8 "password":"<NEW PASSWORD>"
9 }
10 }
Any bugs/issues you may face can be submitted as issues in the Github repo.
npm install strapi-google-auth
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.