google-auth-library-python
google-auth-library-python copied to clipboard
marshaling/json export feature?
I'm currently using AWS lambda, and I'm trying to use this library to interact with some gsuite products. So naturally I want to split up different parts of my project as to embrace micro service architecture that comes with lambda. So here comes my problem, I want to have a Authenticator lambda that can return Authentication to other lambdas, however when using service_account_creds.with_subject(admin-email) it returns a google.oauth2.service_account.Credentialsobject. Now this is great however I'm not able to return this in my lambda, and my attempts at marshaling it myself have failed. So it'd be great if their was a feature to either Marshall the object, or like export it to Json or something like that.
Also if does already exist sorry, I was unable to find it anywhere.
Originally posted by @Jordan-Mesches in https://github.com/googleapis/google-api-python-client/issues/1178
Hi,
The library doesn't provide a way to export the service account credentials. If you want to re-create the service account you would need the original service account JSON object downloaded from https://console.cloud.google.com. https://googleapis.dev/python/google-auth/latest/reference/google.oauth2.service_account.html#google.oauth2.service_account.Credentials
@arithmetic1728 Could you advise if there'a a better way to accomplish what @Jordan-Mesches is looking to do?