Skip to main content

Config for gmail

Jobs that use the gmail adaptor may require authentication. A "credential" for the gmail adaptor will follow the schema below. When using the CLI, you can set up your own state.configuration by using the sample below.

Sample Configuration​

Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmhax0rZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI",
"private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEow...",
"client_email": "my-app@project-id.iam.gserviceaccount.com",
"subject": "user@yourdomain.com"
}

Full Schema​

The full configuration schema describes each attribute of the credential and notes those that are required.

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$comment": "OAuth2",
"properties": {
"access_token": {
"title": "Access Token",
"type": "string",
"description": "Your Gmail OAuth2 access token",
"writeOnly": true,
"minLength": 1,
"examples": [
"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmhax0rZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
]
},
"private_key": {
"title": "Private Key",
"type": "string",
"description": "RSA private key from the Google service account JSON key file. Required for service accounts",
"writeOnly": true,
"minLength": 1,
"examples": [
"-----BEGIN RSA PRIVATE KEY-----\nMIIEow..."
]
},
"client_email": {
"title": "Client Email",
"type": "string",
"description": "Service account email address (e.g. my-app@project-id.iam.gserviceaccount.com). Required for service accounts",
"minLength": 1,
"examples": [
"my-app@project-id.iam.gserviceaccount.com"
]
},
"subject": {
"title": "Subject Email",
"type": "string",
"description": "Gmail user to impersonate via domain-wide delegation (e.g. user@yourdomain.com). For service account",
"examples": [
"user@yourdomain.com"
]
}
},
"type": "object",
"additionalProperties": true
}