fix-version-strapi-google-auth
v0.0.6
Published
GoogleAuth helps you to easily create google authentication available for your users. It uses the official google-auth library to execute the actions. This is a modified plugin strapi-google-auth. https://github.com/arjusmoon860/strapi-google-auth/issues/
Downloads
4
Readme
This is fix version strapi-google-auth on body this errors https://github.com/arjusmoon860/strapi-google-auth/issues/12.
plugin adds uuid when authorizing via google
Also, this version does not imply that you will use the "username" field of the user in strapi, therefore, when registering with this plugin, the "username" place is substituted with the google mail value that was used during registration.
This is done to solve the problem found here:
https://forum.strapi.io/t/authorization-using-google-provider-strapi/25758/5
GoogleAuth
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!
Features
- Official GoogleAPIs integration
- Using strapi default user-permission collection
- JWT Authentication
- Sanitized response
- Highly secure
Activate the Plugin
Add the folling lines of code in the file: config/plugins.js
'fix-version-strapi-google-auth': {
enabled: true,
},
Configuration
- Create a google project from the Google Cloud Console.
- Create OAuth Consent Screen (Nav Menu -> APIs & Services -> OAuth consent screen).
- Go to Credentials, click create credentials -> OAuth Client ID
- Input the CLIENT_ID, CLIENT_SECRET, REDIRECT URL & the Scopes in the plugin page of Strapi, and save it.
How to use
Get Google Authentication URL
{
method: 'GET',
path: 'STRAPI_BACKEND_URL/fix-version-strapi-google-auth/init',
}
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
Authenticate User
Use the REDIRECTION_AUTH_CODE you have recieved from the step 1 to make the second request to authenticate the user.
{
method: 'POST',
path: 'STRAPI_BACKEND_URL/fix-version-strapi-google-auth/user-profile',
data: {
code:REDIRECTION_AUTH_CODE
}
}
Get Authenticated user details
Use the JWT token to fetch the user details.
{
method: 'GET',
path: 'STRAPI_BACKEND_URL/fix-version-strapi-google-auth/me',
header: {
authorization:Bearer <TOKEN>
}
}
Create/Update Password for user account.
Use the JWT token to fetch the user details.
{
method: 'POST',
path: 'STRAPI_BACKEND_URL/fix-version-strapi-google-auth/update-password',
header: {
authorization:Bearer <TOKEN>
},
data:{
"password":"<NEW PASSWORD>"
}
}
Report Bugs/Issues
Any bugs/issues you may face can be submitted as issues in the Github repo.