OAuth2 Applications

Get application info

Returns stored information about an OAuth2 application. Secrets are not included.

get/v1/oauth2/{app}

Request

  • Base URL: https://your-emailengine-host
  • URL: https://your-emailengine-host/v1/oauth2/{app}
  • Auth: HTTP bearer

Path parameters

appstring required

OAuth2 application ID

Example:AAABhaBPHscAAAAH

Headers

x-ee-timeoutinteger

Request timeout in milliseconds. Raises the command timeout above the EENGINE_TIMEOUT default for a long-running request; a value below the default has no effect

Example:30000

Response

Returns the OAuth2 application. Client secrets are masked.

idstring required

OAuth2 application ID

namestring

Display name for the app

descriptionstring

OAuth2 application description

titlestring

Title for the application button

provider'gmail' | 'gmailService' | 'outlook' | 'outlookService' | 'mailRu' required

OAuth2 provider

enabledboolean

Is the application enabled

createdstring date-time

The time this entry was added

updatedstring date-time

The time this entry was updated

includeInListingboolean

Is the application listed in the hosted authentication form

clientIdstring

Client or Application ID for 3-legged OAuth2 applications

clientSecretstring

Client secret for 3-legged OAuth2 applications. Actual value is not revealed.

authoritystring

Authorization tenant value for Outlook OAuth2 applications

redirectUrlstring

Redirect URL for 3-legged OAuth2 applications

googleWorkspaceAccountsboolean

Restrict OAuth2 login to Google Workspace accounts only

serviceClientEmailstring

Service Client Email for 2-legged OAuth2 applications

serviceClientstring

Service client ID for 2-legged OAuth2 applications

serviceKeystring

PEM formatted service secret for 2-legged OAuth2 applications. Actual value is not revealed.

accountsinteger

The number of accounts registered with this application

extraScopesstring[]

Additional OAuth2 scopes requested for this app

skipScopesstring[]

OAuth2 scopes excluded from the defaults for this app

baseScopes'imap' | 'api' | 'pubsub'

OAuth2 base scopes for this app

authMethodstring

Authentication method for Gmail service accounts: serviceKey, externalAccount or metadataServer

cloudstring

Azure cloud type for Outlook OAuth2 applications

tenantstring

Deprecated and unused directory tenant value. Use the authority field instead

externalAccountstring

External account identifier for 2-legged OAuth2 applications. Actual value is not revealed.

accessTokenstring

Access token for app-based authentication. Actual value is not revealed.

pubSubTopicstring

Cloud Pub/Sub topic name for Gmail change notifications

pubSubSubscriptionstring

Cloud Pub/Sub subscription name for Gmail change notifications

pubSubIamPolicyboolean

Whether the IAM policy for the Cloud Pub/Sub topic has been set up

Example response

{
  "id": "AAABhaBPHscAAAAH",
  "name": "My OAuth2 App",
  "description": "App description",
  "title": "App title",
  "provider": "gmail",
  "enabled": true,
  "created": "2021-02-17T13:43:18.860Z",
  "updated": "2021-02-17T13:43:18.860Z",
  "includeInListing": true,
  "clientId": "4f05f488-d858-4f2c-bd12-1039062612fe",
  "clientSecret": "******",
  "authority": "common",
  "redirectUrl": "https://myservice.com/oauth",
  "googleProjectId": "project-name-425411",
  "googleTopicName": "ee-pub-12345",
  "googleSubscriptionName": "ee-sub-12345",
  "serviceClientEmail": "name@project-123.iam.gserviceaccount.com",
  "serviceClient": "9103965568215821627203",
  "serviceKey": "******",
  "accounts": 12,
  "extraScopes": [
    "https://graph.microsoft.com/.default"
  ],
  "skipScopes": [
    "SMTP.Send"
  ],
  "baseScopes": "imap",
  "pubSubApp": "AAAAAQAACnA",
  "authMethod": "serviceKey",
  "cloud": "global",
  "tenant": "f8cdef31-a31e-4b4a-93e4-5f571e91255a",
  "externalAccount": "******",
  "accessToken": "******",
  "pubSubTopic": "projects/project-name/topics/ee-pub-12345",
  "pubSubSubscription": "projects/project-name/subscriptions/ee-sub-12345",
  "pubSubIamPolicy": true,
  "lastError": {
    "response": "Token request failed for gmail (refresh_token, HTTP 400): invalid_grant - Token has been expired or revoked.",
    "description": "Authentication failed",
    "serverResponseCode": "OauthRenewError",
    "tokenRequest": {
      "url": "https://oauth2.googleapis.com/token",
      "method": "post",
      "grant": "refresh_token",
      "provider": "gmail",
      "status": 400,
      "clientId": "1023289917884-h3nu00e9cb7h252e24c23sv19l8k57ah.apps.googleusercontent.com",
      "clientSecret": "GOCSPX...V-Da",
      "authority": "common",
      "serviceClient": "113328088575113530522",
      "signer": "serviceKey",
      "googleProjectId": "project-name-425411",
      "serviceClientEmail": "service-account@project-name-425411.iam.gserviceaccount.com",
      "code": "AAABhaBPHscAAAAH",
      "error": "fetch failed",
      "errorCode": "ECONNREFUSED",
      "flag": {
        "message": "Please verify the OAuth2 application credentials",
        "code": "INVALID_CLIENT_SECRET",
        "url": "https://console.developers.google.com/"
      },
      "userFlag": {
        "message": "The grant for this account has been revoked"
      },
      "scopes": [
        "https://mail.google.com/"
      ],
      "response": {
        "error": "invalid_grant",
        "error_description": "Bad Request"
      }
    }
  },
  "pubSubError": {
    "message": "Failed to process subscription loop",
    "description": "Subscription not found"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.