Skip to main content

consents

Creates, updates, deletes, gets or lists a consents resource.

Overview

Nameconsents
TypeResource
Idsumologic.oauth.consents

Fields

The following fields are returned by SELECT queries:

A list of OAuth consents.

NameDatatypeDescription
idstringUnique identifier for the consent. (example: 0000000006743FDE)
client_idstringThe ID of the registered client that was used in granting consent. (example: zVplCFHcpTDwtktBIQmFI2K6s9HEo4HAtcQD1f1M5eQ) (wire: clientId)
client_namestringThe name of the registered client that was used in granting consent. (example: My OAuth App) (wire: clientName)
authorized_atstring (date-time)Timestamp when the consent was authorized in UTC in RFC3339 format. (example: 2018-10-16T09:10:00.000Z) (wire: authorizedAt)
authorized_userstringIdentifier of the user who authorized the consent. (example: 0000000006743FDD) (wire: authorizedUser)
last_used_atstring (date-time)Timestamp when the consent was last used to grant an access token in UTC in RFC3339 format. Null if never used. (example: 2018-10-16T09:10:00.000Z) (wire: lastUsedAt)
scopesarrayThe scopes that were granted in the consent.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectregionlimit, token, authorized_user, client_idGet a list of OAuth consents within the organization. Administrators can list all consents, while others can only list consents that they have authorized.
deletedeleteconsent_id, regionDeletes the OAuth consent with the given Id.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringSumo Logic deployment (au, ca, ch, de, eu, fed, in, jp, kr, us1, us2). Resolved from the SUMOLOGIC_ENVIRONMENT environment variable when it is set (x-stackQL-envVar, the same variable the Terraform provider reads); otherwise defaults to us2. A WHERE region = '...' value always takes precedence. (enum: [au, ca, ch, de, eu, fed, in, jp, kr, us1, us2], default: us2, x-stackQL-envVar: SUMOLOGIC_ENVIRONMENT)
authorized_userstringFilter consents by the identifier of the user who authorized the consent. (wire: authorizedUser)
client_idstringFilter consents by the clientId of a registered OAuth client. (wire: clientId)
limitinteger (int32)Limit the number of consents returned in the response.
tokenstringContinuation token to get the next page of results.

SELECT examples

Get a list of OAuth consents within the organization. Administrators can list all consents, while others can only list consents that they have authorized.

SELECT
id,
client_id,
client_name,
authorized_at,
authorized_user,
last_used_at,
scopes
FROM sumologic.oauth.consents
WHERE region = '{{ region }}' -- required unless SUMOLOGIC_ENVIRONMENT is set
AND limit = '{{ limit }}'
AND token = '{{ token }}'
AND authorized_user = '{{ authorized_user }}'
AND client_id = '{{ client_id }}'
;

DELETE examples

Deletes the OAuth consent with the given Id.

DELETE FROM sumologic.oauth.consents
WHERE consent_id = '{{ consent_id }}' --required
AND region = '{{ region }}' --required unless SUMOLOGIC_ENVIRONMENT is set
;