I created an app that requires google scopes, and it was working until now. I get this error:
Error
ERROR:Scope has changed from "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://mail.google.com" to "https://mail.google.com/ https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile".
"https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile
https://mail.google.com"
"https://mail.google.com/
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile"
As far as I can see the scope did NOT change. There are 3 scopes before and after, but only the order has changed.
The python code for this is here:
try:
credentials = oauth.fetch_token('https://accounts.google.com/o/oauth2/token',
authorization_response = full_authorization_response_url,
client_secret=client_secret)
except Exception as e:
import traceback
print(traceback.format_exc())
credentials = 'ERROR:'+str(e)
if type(credentials) in (str,unicode):
return "Error<br>"+credentials
it's that last line that seems to be relevant. So google is saying the scope changed, but I can't see why, or how to fix it, since it hasn't changed.
I found that relaxing the token scope on the server solved this problem. It apparently expects the same scopes in the same order, unless you add this line:
os.environ['OAUTHLIB_RELAX_TOKEN_SCOPE'] = '1'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With