News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SA Google+ intergration

Started by SMFHacks.com Team, February 16, 2012, 11:16:04 AM

Previous topic - Next topic

SMFHacks.com Team

Link to Mod

    Requirements:

    • 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



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

    • 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:

    [li]Click on [/li][/list]
    Disclaimer: SMFHacks.com Team is not affiliated with the SMF Team or the SimpleMachines NPO.
    SMFHacks.com -  Paid Modifications for SMF
    Latest Mods:
    Community Suite
    Newsletter Pro SMF Gallery Pro SMF Classifieds SMF Store

    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

    Any thoughts?
    Today, if you're not confused it means you're not thinking clear!

    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
    http://samods.github.io/SAChatBar/

    Xbox Live: smokerthecheese 360 or xbone
    My Work
    Piano Movers / Delivery service
    QuoteMy allies are dead.
    I'm 'bout to be too.
    Zombies are chasing me.
    F*** it, I'm screwed -___-

    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?
    Today, if you're not confused it means you're not thinking clear!

    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
    http://samods.github.io/SAChatBar/

    Xbox Live: smokerthecheese 360 or xbone
    My Work
    Piano Movers / Delivery service
    QuoteMy allies are dead.
    I'm 'bout to be too.
    Zombies are chasing me.
    F*** it, I'm screwed -___-

    Adrek

    Great, now we have FB, Twitter and G+ integration in SMF :D

    Just one question, how can I add button 'login with g+' in SimplePortal block?
    Polskie wsparcie SMF na simplemachines.org

    the simplest solution is most likely the right one

    SA™

    you can use gplus_show_auth_login(); todo this
    http://samods.github.io/SAChatBar/

    Xbox Live: smokerthecheese 360 or xbone
    My Work
    Piano Movers / Delivery service
    QuoteMy allies are dead.
    I'm 'bout to be too.
    Zombies are chasing me.
    F*** it, I'm screwed -___-

    GlitchPC

    #7
    SA™...

    I'm going to be installing this mod in the next few minutes.  I was wondering...for end-user privacy purposes...is there any sample information you can provide me that I can include in my site's privacy policy regarding the use of this application?  If not...can you direct me to any sample information I may be able to use and/or edit to fulfill Google's requirement for this?

    Thanks, in advance...


    Edit...

    What if I don't want users to be able to register using Google+?  Do I have to enter any of the following info?

    Custom login url

    Custom login Image

    Default membergroup ID

    I just want those who already have a Google+ account to be able to share like the Facebook mod does.

    By the way...I will be installing those two, as well, as soon as I get this all figured out...

    SA™

    QuoteI'm going to be installing this mod in the next few minutes.  I was wondering...for end-user privacy purposes...is there any sample information you can provide me that I can include in my site's privacy policy regarding the use of this application?  If not...can you direct me to any sample information I may be able to use and/or edit to fulfill Google's requirement for this?

    Thanks, in advance...

    i usaly just point to the registr page but make sure you have the reg agreement enabled

    QuoteEdit...

    What if I don't want users to be able to register using Google+?  Do I have to enter any of the following info?

    Custom login url

    Custom login Image

    Default membergroup ID

    I just want those who already have a Google+ account to be able to share like the Facebook mod does.

    By the way...I will be installing those two, as well, as soon as I get this all figured out...

    this mod isnt coded just to use the gplus 1 button
    http://samods.github.io/SAChatBar/

    Xbox Live: smokerthecheese 360 or xbone
    My Work
    Piano Movers / Delivery service
    QuoteMy allies are dead.
    I'm 'bout to be too.
    Zombies are chasing me.
    F*** it, I'm screwed -___-

    GlitchPC

    Thanks...

    I see that, now.  Not really what I was looking for but, thanks for the information.   :)

    distante

    Hey SA, It's possible to change the code of "boards to show google+1 button on" for don't show the google+1 button in the boards that I put? because It's more easy in that way!

    SA™

    in sources/gplus/gplushooks.php

    if(in_array($board,$show_gplus) && !empty($modSettings['gp_app_enabled']) && !empty($context['current_topic']) && !empty($_GET['topic']) && !empty($_GET['action']) != 'post'){

    replace with

    if(!in_array($board,$show_gplus) && !empty($modSettings['gp_app_enabled']) && !empty($context['current_topic']) && !empty($_GET['topic']) && !empty($_GET['action']) != 'post'){
    http://samods.github.io/SAChatBar/

    Xbox Live: smokerthecheese 360 or xbone
    My Work
    Piano Movers / Delivery service
    QuoteMy allies are dead.
    I'm 'bout to be too.
    Zombies are chasing me.
    F*** it, I'm screwed -___-

    distante

    Thanks, that worked just fine

    Nitesh Kunnath

    Will this have issue with Enotify ? If so, then which set of code needs to be changed ? can you help me here ?

    Nitesh Kunnath

    I guess you forgot to provide Google+ login button.... I couldnt see a login button in registration (but could see the text for it to register via Google+)
    And I tried, its throwing Enotify errors... May I get the appropriate code to fix this ?

    SA™

    not forget just didnt have one to include in the mod

    QuoteWill this have issue with Enotify ? If so, then which set of code needs to be changed ? can you help me here ?

    post up sources/gplus/gplus.php pls
    http://samods.github.io/SAChatBar/

    Xbox Live: smokerthecheese 360 or xbone
    My Work
    Piano Movers / Delivery service
    QuoteMy allies are dead.
    I'm 'bout to be too.
    Zombies are chasing me.
    F*** it, I'm screwed -___-

    Nitesh Kunnath

    Quote from: SA™ on March 18, 2012, 03:12:40 AM
    not forget just didnt have one to include in the mod

    QuoteWill this have issue with Enotify ? If so, then which set of code needs to be changed ? can you help me here ?

    post up sources/gplus/gplus.php pls
    Ok, so where should I add the image to make it work (I have my own G+ image)

    Here is the requested file :)

    SA™

    http://samods.github.io/SAChatBar/

    Xbox Live: smokerthecheese 360 or xbone
    My Work
    Piano Movers / Delivery service
    QuoteMy allies are dead.
    I'm 'bout to be too.
    Zombies are chasing me.
    F*** it, I'm screwed -___-

    Nitesh Kunnath

    Quote from: SA™ on March 18, 2012, 03:19:30 AM
    in gplus admin
    Ok, I forgot to observe it closely :P
    Custom login Image ;D ... :)

    SA™

    in that file find

    $gplus_log_url = !empty($modSettings['gp_app_custon_logurl']) ? $modSettings['gp_app_custon_logurl'] : $scripturl;

    redirectexit($gplus_log_url);


    replace with

    if ((!empty($_SESSION['login_url']) && strpos($_SESSION['login_url'], 'enotify')) || empty($_SESSION['login_url'])){

       $gplus_log_url = !empty($modSettings['gp_app_custon_logurl']) ? $modSettings['gp_app_custon_logurl'] : $scripturl;

       redirectexit($gplus_log_url);
    }
    else{
       
        $temp = $_SESSION['login_url'];
        $gplus_log_url = !empty($modSettings['tw_app_log_url']) ? $modSettings['tw_app_log_url'] : $temp;
        unset($_SESSION['login_url']);
        redirectexit($gplus_log_url);
    }
    http://samods.github.io/SAChatBar/

    Xbox Live: smokerthecheese 360 or xbone
    My Work
    Piano Movers / Delivery service
    QuoteMy allies are dead.
    I'm 'bout to be too.
    Zombies are chasing me.
    F*** it, I'm screwed -___-

    Advertisement: