Customizing SMF > Modifications and Packages

SA Google+ intergration

(1/15) > >>

SMFHacks.com Team:
Link to Mod

Reqirements:

* CURL PHP extension
* JSON PHP extension
* PHP Version 5
Features:

* Login with google+
* Register with google+
* Google+ logs
* Set a custom login url
* Set a custom login image
* Choose what group google+ users goto
* Google+1 button on boards you choose
Creating your application:

* Visit the Google API Console to generate OAuth2 client id, OAuth2 client secret, and register your OAuth2 redirect uri.
https://code.google.com/apis/console
* Click on "Services" in the left column and turn on "Google+ API".
* Click on "API Access" in the left column and click the button labeled "Create an OAuth2 client ID"
* Give your application a name and click "Next"
* Select "Web Application" as the "Application type"
* Click on (more options) and in Authorized Redirect URIs enter
http://www.example.com/index.php?action=gplus
* in Authorized JavaScript Origins enter
http://www.example.com
* Click "Create client ID"
now you have your OAuth2 client id, OAuth2 client secret keys input these into gplus admin area

App setup guide with pictures

SA Google+ is released under the Mozilla Public License v1.1

shumilica:
After doing everything required, put an image for login (you can use this one if you want for the mod: www.fcrp.ro/forum/sign-in-with-google.png ), clicking the image and allowing my app to access the info, i get this error:

--- Quote ---Fatal error: Uncaught exception 'apiServiceException' with message 'Error calling GET https://www.googleapis.com/plus/v1/people/me?alt=json&key=4142341.apps.googleusercontent.com: (404) Not Found' in /home/xxxxxx/public_html/forum/gplusauth/io/apiREST.php:86 Stack trace: #0 /home/xxxxxx/public_html/forum/gplusauth/io/apiREST.php(56): apiREST::decodeHttpResponse(Object(apiHttpRequest)) #1 /home/fcrpro/public_html/forum/gplusauth/service/apiServiceResource.php(148): apiREST::execute(Object(apiServiceRequest)) #2 /home/xxxxxx/public_html/forum/gplusauth/contrib/apiPlusService.php(204): apiServiceResource->__call('get', Array) #3 /home/xxxxxx/public_html/forum/Sources/GPlus/GPlusHooks.php(228): PeopleServiceResource->get('me') #4 /home/xxxxxx/public_html/forum/Sources/GPlus/GPlus.php(98): gplus_init_auth() #5 /home/xxxxxx/public_html/forum/Sources/GPlus/GPlus.php(50): gplus_main() #6 /home/xxxxxx/public_html/forum/index.php(153): GPlus() #7 {main} thrown in /home/xxxxxx/public_html/forum/gplusauth/io/apiREST.php on line 86

--- End quote ---

Any thoughts?

SA™:
the special userID "me" does only work only if you are calling on behalf of an OAuth authenticated user looking at your query URL you tried to call it with your simple API key this is why it won't work As there is no user connected with this query the API does not know who "me" is and therefore returns a 404.

so 4142341 is the key you have specifyed wich is incorrect see here for setting up properly
http://www.sa-smf.com/community/index.php?action=kb;area=article;cont=42

shumilica:
I changed that number when posting the error here, but it wasn't about the key. It was because i was trying to log on with a google apps account which doesn't have g+ enabled.
When I tried to log in from a google account with g+ it worked flawlessly.

Sorry for the trouble, maybe you can make a workaround so that it will return an understandable error to the one who wants to login with these kind of credentials?

SA™:
to me these api errors are understandble but i can see that it may not be the case for every one usaly a quick google finds and anser

Navigation

[0] Message Index

[#] Next page

Go to full version