Is it possible to use Google Credentials for GMAIL REST API without using impersonation??
In many examples of GMAIL REST API i see is mandatory to use an impersonation account associated to a domain and Google APPS. I just want to use GMAIL REST API api server-to-server :
f.e:
GoogleCredential credential = new GoogleCredential.Builder().setTransport(httpTransport)
.setJsonFactory(jsonFactory)
.setServiceAccountId(serviceAccountUserEmail)
**.setServiceAccountUser("[email protected])**
.setServiceAccountScopes(SCOPES)
.setServiceAccountPrivateKeyFromP12File(
new java.io.File(SERVICE_ACCOUNT_PKCS12_FILE_PATH))
.build();
The matter is that i don't have any domain and i use just a GMAIL account...but i don't get any way to authorize, for example : [email protected]
The servive acccount id [email protected]"; is a "client account" created with the [email protected]
This has no sense , i don't want to impersonate with no other account of another domain, and i don't get any way to authozize [email protected] .
Just only works, if you have an account to impersonate of other domain associated with Google Apps, and to get Google Apps...you need a domain.
Any advise??
Gmail API is available for free, but it has certain daily usage limits for API calls. Daily usage: 1 billion API calls per day. Per User Rate Limit: 250 API calls per user per second.
In OAuth 2.0, the following three parties are involved: The user, who possesses data that is accessed through the API and wants to allow the application to access it. The application, which is to access the data through the API on the user's behalf. The API, which controls and enables access to the user's data.
For example, if a principal has the Service Account User role on a service account, and the service account has the Cloud SQL Admin role ( roles/cloudsql. admin ) on the project, then the principal can impersonate the service account to create a Cloud SQL instance.
You may just want to simply use OAuth 2.0 for Web Server Applications. Assuming you want the authorization for more than an hour, you can use refresh tokens.
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