I am currently working on some code that connects to our Google apps domain, makes some administrative changes and then impersonates different users in our domain and uploads data to their drive, email and calendar. What I'm trying to do is figure out the proper way to use SignedJwtAssertionCredentials and change the "sub" kwarg. Do I need to redo the whole oauth process for each user I want to impersonate, i.e...
http = httplib2.Http()
credentials = SignedJwtAssertionCredentials(service_account, key, scope=api_scopes, sub=current_user)
http = credentials.authorize(http)
service = build(api_service, api_version, http=http)
or is there a way to just update/modify the sub kwarg and then re-authorize the httplib2 object?
I tried doing it the first way I described and it doesn't seem to work, about half way through the programs execution, I start getting odd errors saying,
WARNING:oauth2client.util:new_request() takes at most 1 positional argument (2 given)
Does anyone have any ideas on why I'm getting this error and or the best way I can implement the oauth process to do what I need it to?
Thanks!