My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 24: GoldenGate Plugin: Authentication Error - AuthSub token invalid or not set. Login to Google Photos
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


 
Reported by gottalov...@gmail.com, Oct 18, 2008
i click link, login with google, it stores the authsub token ok, but
message still stays every page load, even though i can still access the
album through the media library.

What version of the plugin are you using?
1.5

Please provide any additional information below.
I even have my blog URL "registered" at google.  i dont know why it keeps
doing that.  what things should i check? you want my phpinfo dump?


Oct 19, 2008
#1 gottalov...@gmail.com
Some more info for you.  The problem is in this function:

goldengate_valid_authsub

I echoed out the $resp value (not using secure) and its coming back with HTTP 401 -
Unauthroized.  However, i am still able to upload to albums and get albums, so not
sure whats going on.
Oct 20, 2008
Project Member #2 xir...@gmail.com
Hmm when you registered your domain, what did you put down for "Target URL path
prefix" on the manage domains page?


https://www.google.com/accounts/ManageDomains

This has to be a prefix of your blog address (you can set it to the bare domain if
you want e.g. http://www.example.com) or it will cause problems.
Oct 20, 2008
#3 gottalov...@gmail.com
target = 
http://blog.ideasinwood.net/wp-admin
screenshot.jpg
65.5 KB   View   Download
Oct 20, 2008
Project Member #4 xir...@gmail.com
Very odd. I suppose it does the same thing if you clear the AuthSub token in the
settings page and try to re-authorize again?

If so can you email me directly and send me an AuthSub token that it's using that
fails the validity check but is still usable? 
Oct 20, 2008
#5 gottalov...@gmail.com
Yes it does the same thing when clearing, uninstalling the plugin, deleting all the
plugin files, and re-installing.  Im not to sure about givin you the authsub token. 
my remedy was to comment out everything in the function i mentioned above, and force
a return true.  the error goes away, and able to still use the plugin.

Like I said, when i echoed the $resp variable it echo'd HTTP 401 Unauthorized.
Dec 8, 2008
#6 jignaci...@gmail.com
i've got the same problem, and i'd tried everything from google and so on. The
problem is always there.
Dec 10, 2008
Project Member #7 xir...@gmail.com
I'm not sure how there is a token that is rejected by the AuthSubInfo call but still
works with the API... can you share a token that has this behavior? (You can revoke
it first in the 'authorized websites' section of your Google Account so it can no
longer be used.) I might then be able to get the accounts people to figure out what
is amiss.
Dec 10, 2008
#8 gottalov...@gmail.com
This is what I did to make it work:

function goldengate_valid_authsub() {

    $token = goldengate_get_authsub_token();

    if($token) {
        return true;
    }

    return false;
}

instead of:

function goldengate_valid_authsub() {

    $token = goldengate_get_authsub_token();

    if($token) {
      try {
        $useSslProxy = goldengate_get_option('goldengate_use_ssl_proxy', 0);
        if($useSslProxy) {
          $sslProxyHost = goldengate_get_option('goldengate_ssl_proxy_host', '');
          $sslProxyPort = goldengate_get_option('goldengate_ssl_proxy_port', '');
          $client = new Zend_Http_Client('https://www.example.com/', array(
                 'adapter'      => 'Zend_Http_Client_Adapter_Proxy',
                 'proxy_host'   => $sslProxyHost,
                 'proxy_port'   => intval($sslProxyPort)
          ));
          $resp = Zend_Gdata_AuthSub::getAuthSubTokenInfo($token, $client);
        }
        else {
          $resp = Zend_Gdata_AuthSub::getAuthSubTokenInfo($token);
        }

        if(preg_match('/^Target=(.+)\nSecure=(.+)\nScope=(.+)/', $resp)) {
            return true;
        }
      }
      catch(Zend_Gdata_App_HttpException $e) {
        goldengate_print_error("Problems checking token. Check proxy?");
      }

        return true;
    }

    return false;

}



There's something wrong with the function.
Dec 10, 2008
#9 gottalov...@gmail.com
I just noticed, in this function you are calling Zend_HTTP_Client.  How come you
aren't loading the class at the top of the file llike you do with the Zend_GDATA
classes?  
Dec 20, 2008
Project Member #10 xir...@gmail.com
I think that gets loaded implicitly when you load any of the service classes. I could
check on that. It should error properly if it's not.

Hmm I wonder what part of the info check is failing. Mostly I did it that way because
I wanted a way to quickly check if the token worked after installing so I could pop
out an obvious error.

Maybe it would be better in the future to just handle the error on the browse/upload
tabs instead. Though it would suck to upload a photo only to find out it wasn't ready. 
Jul 1, 2009
#11 webs...@clioforum.net
I altered your code to change the default values of the insert options, no i get this
issue about the authentication code, even tho the plugin works fine.

I am using wp 2.8, but this is the only plugin that does exactly what i want!

Andy
Jul 1, 2009
Project Member #12 xir...@gmail.com
Can you snoop the HTTP request that it's making that is getting back the failed token?

Powered by Google Project Hosting