"sign in with google" possible?

Install and configure FormaLMS and DoceboCE
turbo2ltr
Newbie
Posts: 6
Joined: Mon Apr 04, 2022 1:53 pm

"sign in with google" possible?

Post by turbo2ltr »

Is it possible to use Sign in with Google?

I manage a Google Workspace for Non-Profit account with 500+ members that I want to be able to authenticate formalms with.

I looked into the SSO and I don't see any way to use that with my Workspace account. I don't see anywhere in the SSO/SAML setup in Workspaces that I can input or generate a token. Seems formalms SSO is outdated using tokens instead of public keys. My Workspace subscription does not include LDAP service.

So even though the promotional material says you can use google as an identity provider, I am not seeing any way to do it. The provided half page instructions on SSO aren't very useful either as I don't see any correlation with what it says and any setup I can do in workspaces.

Anyone have any info on doing this? Thanks.
alfa24
Senior Boarder
Posts: 2009
Joined: Fri Nov 24, 2017 8:45 am

Re: "sign in with google" possible?

Post by alfa24 »

Go to plugins management.
Install, activate and fill settings for Google Auth.
Per supporto GRATUITO contattatemi in privato qui
turbo2ltr
Newbie
Posts: 6
Joined: Mon Apr 04, 2022 1:53 pm

Re: "sign in with google" possible?

Post by turbo2ltr »

Hmm I went to the plugin page on the website looking for something like this but it's not listed there at all.

Are there any instructions listed anywhere? I mean I know how to create the OAuth credentials and I did so. But all I get is a "social login" section on the login page. If I click the G I get "you are connecting social account [my email]" with a cancel button. ON the left it says "User not found"

Ok, so how do I actually log in using google? This seems to tell me I still need to manually create accounts in forma?

Thanks.
alfa24
Senior Boarder
Posts: 2009
Joined: Fri Nov 24, 2017 8:45 am

Re: "sign in with google" possible?

Post by alfa24 »

Double check you configuration plugin page.
Per supporto GRATUITO contattatemi in privato qui
turbo2ltr
Newbie
Posts: 6
Joined: Mon Apr 04, 2022 1:53 pm

Re: "sign in with google" possible?

Post by turbo2ltr »

Double check you configuration plugin page.
What am I looking for? There's only two fields, OAuth key/secret, which I filled out. No other config or instructions. The OAuth part seems to be working. It redirects to google to sign in, and redirects back to formalms after I provide my google credentials, but that's when I get
Capture.PNG
alfa24
Senior Boarder
Posts: 2009
Joined: Fri Nov 24, 2017 8:45 am

Re: "sign in with google" possible?

Post by alfa24 »

Are you able to login if a user exists with the same email or username as Google account?
Per supporto GRATUITO contattatemi in privato qui
turbo2ltr
Newbie
Posts: 6
Joined: Mon Apr 04, 2022 1:53 pm

Re: "sign in with google" possible?

Post by turbo2ltr »

alfa24 wrote: Mon Apr 04, 2022 6:39 pm Are you able to login if a user exists with the same email or username as Google account?
Nope, same screen comes up with the email address of the google account as both username and email in forma.
alfa24
Senior Boarder
Posts: 2009
Joined: Fri Nov 24, 2017 8:45 am

Re: "sign in with google" possible?

Post by alfa24 »

So, we've just found a bug!
If you need it to be fixed in brief, you can contact me with a private message.
Per supporto GRATUITO contattatemi in privato qui
turbo2ltr
Newbie
Posts: 6
Joined: Mon Apr 04, 2022 1:53 pm

Re: "sign in with google" possible?

Post by turbo2ltr »

Not sure if it's a bug or a configuration issue.

I can say that this line in the googleauth plugin returns false even though $user_info['id'] is set to an ID.

Code: Select all

$user = \DoceboUser::createDoceboUserFromField("google_id", $user_info['id'], "public_area");
This fails because it's looking for an existing user with the google_id set to the user that logged in with google, but that is not something that is set through the user management so there are no users with that google_id.

I changed the line to

Code: Select all

$user = \DoceboUser::createDoceboUserFromField("email", $user_info['email'], "public_area");
And this works if the account with a matching email is already set up in forma.

Maybe it's not supposed to work the way I think. Was the intent to create new users based on the google login or is it expected to already have the accounts set up, and just use google as an identity provider for existing accounts?

Thanks!
turbo2ltr
Newbie
Posts: 6
Joined: Mon Apr 04, 2022 1:53 pm

Re: "sign in with google" possible?

Post by turbo2ltr »

Ok I got it working.
I duplicated the GoogleAuth plugin so I could make my own variant.
My variant will validate the Google Workspace domain as we only want people with valid workspace account under our domain to access. And it creates a new forma account if one doesn't exist for the user logging in so the user (or admin) doesn't have to manually register.

Thanks.
Post Reply