Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

google + plugin crushing

Zaktwo4Zaktwo4 New
edited October 2014 in Vanilla 2.0 - 2.8

try to use google + for default signin method this error show up:

/public_html/forum/plugins/GooglePlus/class.googleplus.plugin.php

edit
when i go to the function i find this:

public function SignInButton($type = 'button') {
$Target = Gdn::Request()->Post('Target', Gdn::Request()->Get('Target', Url('', '/')));
$Url = $this->AuthorizeUri(array('target' => $Target));

  $Result = SocialSignInButton('Google', $Url, $type);  
  return $Result;

}

Comments

  • disabled google + plugin and its working fine now

  • but if any one still have a solution for this please tell me about it

  • LincLinc Detroit Admin
    edited October 2014

    Add this code to library/core/functions.render.php:

    if (!function_exists('SocialSignInButton')) {
       function SocialSignInButton($Name, $Url, $Type = 'button', $Attributes = array()) {
          TouchValue('title', $Attributes, sprintf(T('Sign In with %s'), $Name));
          $Title = $Attributes['title'];
          $Class = val('class', $Attributes, '');
    
          switch ($Type) {
             case 'icon':
                $Result = Anchor('<span class="Icon"></span>',
                   $Url, 'SocialIcon SocialIcon-'.$Name . ' ' . $Class, $Attributes);
                break;
             case 'button':
             default:
                $Result = Anchor('<span class="Icon"></span><span class="Text">'.$Title.'</span>',
                   $Url, 'SocialIcon SocialIcon-'.$Name.' HasText ' . $Class, $Attributes);
                break;
          }
    
          return $Result;
       }
    }
    

    This should get filed as an issue to backport to 2.1.

  • `401. That’s an error.

    Error: invalid_client

    no application name

    Request Details
    That’s all we know.`

    that's what i got after adding the fonction

  • AdrianAdrian Wandering Spirit Montreal MVP
    edited October 2014

    @Zaktwo4‌ Did you create info in the consent screen with Google API console? You need to do this before it works, if this is your first time using Google API's.

  • @Adrian said:
    Zaktwo4‌ Did you create info in the consent screen with Google API console? You need to do this before it works, if this is your first time using Google API's.

    didn't do that but that's what happened after

    Whoops!
    invalid_client

    still the same problem tho if i remove Linc code it still give me the same problem the invalid_client error

  • Zaktwo4Zaktwo4 New
    edited October 2014

    0 /home/xxxxxx/public_html/forum/plugins/GooglePlus/class.googleplus.plugin.php(85): GooglePlusPlugin::Curl('https://account...', 'POST', Array)

    1 /home/xxxxxx/public_html/forum/plugins/GooglePlus/class.googleplus.plugin.php(288): GooglePlusPlugin->GetAccessToken('4/pGwpIwgwO9TaV...')

    2 [internal function]: GooglePlusPlugin->EntryController_GooglePlus_Create(Object(EntryController), '4/pGwpIwgwO9TaV...', 'target=discussi...')

    3 /home/xxxxxx/public_html/forum/library/core/class.dispatcher.php(337): call_user_func_array(Array, Array)

    4 /home/xxxxxx/public_html/forum/index.php(46): Gdn_Dispatcher->Dispatch()

    5 {main}>

    after adding the debug trace this is what i got.
    and a post : POST https://accounts.google.com/o/oauth2/token

  • AdrianAdrian Wandering Spirit Montreal MVP

    Can you also check you have no extra spaces after client secret? That is a common reason for this error.

  • @Adrian said:
    Can you also check you have no extra spaces after client secret? That is a common reason for this error.

    thank you very much it was the reason for the whole problem.
    facebook plugin have the same error, i think its secret with extra space

  • AdrianAdrian Wandering Spirit Montreal MVP

    @zaktwo4 glad that worked. It usually happens with the cut and paste for some reason. I have battled this dragon before :)

  • Zaktwo4Zaktwo4 New
    edited October 2014

    @Adrian said:
    zaktwo4 glad that worked. It usually happens with the cut and paste for some reason. I have battled this dragon before :)

    thank you again Adrian you are the best.

  • the only thing i am missing now is google+ logo but its ok not a problem

  • Applied the fix and I can now see the Google+ login button but now my Facebook and Twitter buttons are gone. The login text-link doesn't work either. Enabling Google+ in Social breaks the login altogether on my forum. Vanilla 2.1 + Boostrap Theme + GooglePlus from Github.

Sign In or Register to comment.