Has anyone used nsg-module-google module for social login? I’ve been messing with it for awhile and just not getting anywhere. I loaded via commandbox and it downloaded a couple of dependencies (nsg-module-oauth and nsg-module-security). Mainly I’m wondering -
How do you interface with this module?
The google auth uses oauth2 and it’s mentioned in the readme for nsg-module-google but the dependency ndg-module-oauth says "Currently this module only supports OAuth v1 ". ??
I’ve tried quite a few things and getting nowhere. Has anyone on here used this?
Tropicalista, you can’t imagine how happy I was to see that work! I had to wade thru Coldbox’s info on modules a bit but I got there!
Question - I’m getting there via [site]/socialite/home/auth?provider=google but I see in your readme what looks like a way to call it from within a handler ( socialite.init().with(‘facebook’).redirect() ) . Wondering proper way to implement this module. Was thinking a generic login page has links to /socialite/home/auth?provider=xyz but maybe I’m missing the point?
Thank you!
Irv
PS - socialitemanager.cfc seems to have a stray comma on line 82. Wasn’t sure how to contact you except here - thanks!
so /socialauth/response/google should go to “socialite/home.response” correct? I’ve tried writedumping rc and instead I just get the text “google” on the page (no html). Can’t figure out where that’s coming from.
“handlers.Main”,"The event: socialauth is not valid registered event.
I’ve reloaded modules. Still the same. Coldbox doc say these are auto-loaded (or I think that’s what it says). If I manually add to the apps routes.cfm then of course sees it but … ???
This seems really odd. It says the module name is not valid yet there it is in the list of valid modules…
The module: socialite is not valid. Valid Modules are: cbstorages,cbjavaloader,cbmessagebox,cbdebugger,socialite,cbsecurity,cbantisamy,cbi18n,cbvalidation"
Also does anyone know if this statement from Luis back in 2011 is still true?
“the entry point is for documentation purposes and also for the module debugger to link to your module. Maybe later we can find more uses for it.”
The whole entrypoint thing is driving me crazy. I’m trying to figure out why it’s not working like it seems (to me anyway) that it should.
Let’s say you want the module be installed on www.myapp.com/socialauth simply set the entrypoint as “socialauth”. Of course you can use whatever name.
The rest of the setting should not be touched, except the oauth setting where you should put the credentials of the social login. You should put something like this:
After this simply add a link point to socialauth/facebook or socialauth/google or whatever oauth you like(currently supported also github and linkedin). You will be prompted to facebook login and then back to redirect url:
I’ve been 'round and 'round with it for awhile and I have it working - I believe. There’s a couple of issues still that I’ll figure out. They’re probably on my end anyway. That said, if you need for this to work with google and you use Lucee you’ll need version 4.5.2.012+ for this to work. Note this is presently a development release. Has to do with wildcards with http() and the certificate rules. The error you’ll see with 4.5.1.023 is “Host name ‘www.googleapis.com’ does not match the certificate subject provided by the peer (CN=*.storage.googleapis.com, O=Google Inc, L=Mountain View, ST=California, C=US)”. It might work on older versions of Lucee - not sure.
I’ll post back once I’ve tested it all the way thru.
I just replied without noticing this update in my email. I couldn’t get that entry point to work. Went thru the Coldbox docs to no avail. It seemed to be simply an ignored value. I could put it (the mapping) in routes.cfm and all was fine but that entry in the moduleconfig didn’t appear to do anything. I’ll try it again.
Once I got things going I had issues with google (the one I was using to test with). I just posted about that a minute ago. Is working now that I’m using latest (dev) version of Lucee.
error is “The event: socialauth.google is not valid registered event.”
I then found this response by Luis from 4 years ago to a question about “this.entryPoint”. He writes - “the entry point is for documentation purposes and also for the module debugger to link to your module. Maybe later we can find more uses for it.”
I’m thinking this.entryPoint = “socialauth” doesn’t do anything as far as URLs are concerned. It sure appears that way anyway. Are you sure you don’t have “socialauth” set as a path in some other fashion? Sorry to doubt but this just isn’t working for me.
I know I’m set up right on the main functionality because /socialite/home/auth?provider=google works as it should. It’s the routes and the entrypoint entries that are not working.
the this.entryPoint is used for modules to determine their entry point, if you are getting that error then you need to double check the routes are calling handlers and actions that do exist in that module.
The pattern is very clear, it is /provider/:provider which means it is going to look for #entryPoint#/provider/#provider# notice I placed cfoutput variables there to expand it out and make it clearer.
But yes, the :provider will create a variable called provider to hold the value entered there.
Sorry I need to clarify, that the :provider is indeed removed from the route, but the /provider will be added to the route and it will look for the home/auth in the route which expans out to
#entrypoint#/provider/home/auth
The url to execute that will be what I said above.