For App Engine apps to authenticate itself to other apps through oauth is using the following code:
auth_token, _ = app_identity.get_access_token(email_scope)
headers['Authorization'] = 'Bearer ' + auth_token
However, in Chromium Rietveld, this won't work, because it only supports client-id-based oauth with oauth.get_client_id(email_scope). And for app engine requests with the above header, it just returns 'anonymous'.
We could support per-email oauth with oauth.get_current_user(email_scope).email(), as it returns the App Engine account (APP_ID@appspot.gserviceaccount.com) for the above header.
Comment 1 by bugdroid1@chromium.org
, Jun 16 2016