I need help in implementing self user registration with Google Sign-in (javascript api). This will be crm user not portal user. Then after registration auto login that user in crm.
Announcement
Collapse
No announcement yet.
User self registration with Google Sign-in
Collapse
X
-
Likely you need to obtain google api key for your website/app, find a php oauth library, add it to espo using composer, set the "redirect/login" url (from google app oauth configuration page) to a custom entrypoint from which you invoke the oauth library to handle the login: silently create the user entity if it does not exist or log in the user automatically (replicate the code from core auth class). There may be easier ways but idk.Last edited by tothewine; 06-21-2020, 12:20 PM.
- Likes 2
-
Thanks @tothewine,
I was thinking another flow for google sign in , that is ->
1. Create a "Signin with Google" button in loginView. Click on this button will open google authentication popup. After the user authenticate crm. The email and other information will be available on loginView (frontend).
2. After this send ajax request from loginView(frontend) to custom controller(backend) and create user entity there.
Is there any flaws in this logic ?
-
Here is an example: https://developers.google.com/identity/sign-in/web
at the end of the success event handler you do the ajax request with the data to your custom php code that creates an user entity (first time) and logs in the user.Last edited by tothewine; 06-22-2020, 01:48 PM.
- Likes 1
Comment
Comment