I want to utilize gdata.apps.audit.service.AuditService to create mailbox export requests (specifically via createMailboxExportRequest). Is it possible to access this api authenticating via oauth or another means? I'm trying to avoid requiring a user to provide a username and password.
Here is an example piece of code:
audit_service = gdata.apps.audit.service.AuditService(domain="test.com")
#would like to not use ClientLogin
client = audit_service.ClientLogin("[email protected]", "superSecretPassword") # <------
audit_service.createMailboxExportRequest(user="target_user", begin_date=None, end_date=None, include_deleted=True, search_query=None)
audit_service.getAllMailboxExportRequestsStatus()
I'm successfully using oauth2/client_secrets for other admin/audit APIs but I can't figure out how to get the createMailboxExportRequest without ClientLogin. Any help would be appreciated.
The easiest way I've found to hack OAuth 2.0 into the older GData APIs is to build the GData service (but not authorize it), then build a credentials service like you would for the newer OAuth 2.0 discovery Google APIs, then add the proper credentials as a header on the GData service: