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??
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…