Token error in Google Apps Marketplace application

2020-08-01 08:01发布

问题:

We have a Google Apps Marketplace app which is deployed on App Engine, and uses the gdata APIs and as of a 3 days ago (20 of June) we started getting this error in the logs:

Unauthorized - Server responded with: 401, <HTML>
<HEAD>
<TITLE>Token invalid - Target is disabled.</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Token invalid - Target is disabled.</H1>
<H2>Error 401</H2>
</BODY>
</HTML>

This is the piece of code that raises the error:

two_legged_oauth_token = gdata.gauth.TwoLeggedOAuthHmacToken(CONSUMER_KEY, CONSUMER_SECRET, admin_email)

# Email Settings API client
email_settings_client = gdata.apps.emailsettings.client.EmailSettingsClient(domain=domain)
email_settings_client.auth_token = two_legged_oauth_token
sig = email_settings_client.RetrieveSignature(username=guid) #this line throws the error

I know the APIs and the two legged auth are about to be deprecated, but Google says it's not supposed to happen until next month or so. Nothing in the code or the servers has changed, so I'm not sure what the error says, and googling hasn't provided me with any insights. What this might mean?

回答1:

Just a long shot, but if you are using OpenId for authentication, this service may have been closed down.

Here you find important migration details : https://developers.google.com/+/api/auth-migration