Testing nodebb-plugin-sso-google
-
@ww9rivers additionally, make sure you do not have any custom CSS code that interferes...
-
Yes. I am using the Harmony theme. This is a fresh installation, no custom CSS code is used.
I checked the
logs/output.log
, there was no error except for 2 warnings:WARNING: The keyword 'none' must be used as a single argument. ../../node_modules/bootstrap/scss/mixins/_box-shadow.scss 10:9 box-shadow() ../../node_modules/bootstrap/scss/forms/_form-control.scss 40:7 @import bootstrap/scss/_forms.scss 3:9 @import - 19:9 root stylesheet WARNING: The keyword 'none' must be used as a single argument. ../../node_modules/bootstrap/scss/mixins/_box-shadow.scss 10:9 box-shadow() ../../node_modules/bootstrap/scss/forms/_form-select.scss 32:7 @import bootstrap/scss/_forms.scss 4:9 @import - 19:9 root stylesheet
Here is the list of all installed plugins:
$ ./nodebb plugins Active plugins: * [email protected] (installed, disabled) * [email protected] (installed, enabled) * [email protected] (installed, disabled) * [email protected] (installed, enabled) * [email protected] (installed, enabled) * [email protected] (installed, enabled) * [email protected] (installed, enabled) * [email protected] (installed, disabled) * [email protected] (installed, disabled) * [email protected] (installed, enabled) * [email protected] (installed, enabled) * [email protected] (installed, enabled) * [email protected] (installed, disabled) * [email protected] (installed, disabled) * [email protected] (installed, disabled) * [email protected] (installed, enabled)
Again, thank you for the replies.
-
Thanks @baris -- Took me a while to get back to this.
I ran https://community.nodebb.org/api/login?pretty=1 in a private window and get a JSON object with this:
alternate_logins: true,
and "authentication" containing 4 objects (the login's I see on the login page.However, when I did that on my own installation, I got:
alternate_logins: false,
and "authentication" an empty list.I know I have built and restarted my nodebb installation after installing and activating nodebb-plugin-sso-google . . . what else should I look next??
Thank you!
-
Debug this line https://github.com/NodeBB/NodeBB/blob/master/src/routes/authentication.js#L83 and see if loginStrategies is filled by the sso-google plugin. If the plugin is activated and working then it should fill that array.
If there is an array during startup the plugin might not be activated hence the empty array.
-
Did that. The loginStrategies started as an empty array, and ends an empty array after that statement -- The Google SSO plugin did not fill it.
I'm trying to read the Google.init() function but that doesn't seem to be the one to debug next . . . and I'm getting a sleepy...maybe tomorrow.
-
The strange thing is . . . there is no error message.
I tried with
logger
configured to debug level, this is all I got in the logs/output.log:Clustering enabled: Spinning up 1 process(es). 2024-01-28T05:04:42.055Z [4567/645445] - info: Initializing NodeBB v3.6.4 https://bbs.9rivers.com 2024-01-28T05:04:43.664Z [4567/645445] - info: [socket.io] Restricting access to origin: https://bbs.9rivers.com:* 2024-01-28T05:04:43.928Z [4567/645445] - info: [api] Adding 0 route(s) to `api/v3/plugins` 2024-01-28T05:04:43.955Z [4567/645445] - info: [router] Routes added 2024-01-28T05:04:43.962Z [4567/645445] - info: 🎉 NodeBB Ready 2024-01-28T05:04:43.964Z [4567/645445] - info: 🤝 Enabling 'trust proxy' 2024-01-28T05:04:43.967Z [4567/645445] - info: 📡 NodeBB is now listening on: 0.0.0.0:4567 2024-01-28T05:04:43.967Z [4567/645445] - info: 🔗 Canonical URL: https://bbs.9rivers.com
-
Had a bit of time to try to debug this. I started the up NodeBB in VS Code in a debug session and set break points in
Google.init()
andGoogle.getStrategy()
functions. The debugger stopped in both. However, inGoogle.getStrategy()
I found bothGoogle.settings.id
andGoogle.settings.secret
undefined
.It seems that the async call to
meta.settings.get('sso-google', ...)
finished after the call toGoogle.getStrategy()
, so even though the the Google ID and secret are loaded fine, they are too late.I am running NodeBB with a PostgreSQL backend for that matter.
-
@ww9rivers thanks for debugging, I've identified the issue. It will be fixed in our next patch release. https://github.com/NodeBB/NodeBB/issues/12365
-