OAuthGrant
Authorization granted by an account to an OAuth application. Deleting it signs the application out.
This object can be configured from the WebUI under Account › Credentials › Connected Applications
Fields
Section titled “Fields”accountId
Section titled “accountId”Type:
Id<Account>· read-onlyIdentifier for the account that granted the authorization
clientId
Section titled “clientId”Type:
String· server-setIdentifier of the OAuth client that received the authorization
clientName
Section titled “clientName”Type:
String?· server-setName of the application, as provided by the client or its administrator
clientKind
Section titled “clientKind”Type:
OAuthClientKind· server-setHow the application was registered. Dynamically registered applications and Client ID Metadata Documents are not verified by an administrator.
scopes
Section titled “scopes”Type:
Set<OAuthScope>· server-setServices the application was given access to. First-party applications have full access to the account.
remoteIp
Section titled “remoteIp”Type:
IpAddr?· server-setIP address from which the authorization was granted
createdAt
Section titled “createdAt”Type:
UTCDateTime· server-setDate the authorization was granted
lastUsedAt
Section titled “lastUsedAt”Type:
UTCDateTime· server-setDate the application last renewed its access
JMAP API
Section titled “JMAP API”The OAuthGrant object is available via the urn:stalwart:jmap capability.
x:OAuthGrant/get
Section titled “x:OAuthGrant/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysOAuthGrantGet permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:OAuthGrant/get", { "ids": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:OAuthGrant/set
Section titled “x:OAuthGrant/set”This is a standard Foo/set method as defined in RFC 8620, Section 5.3.
Supports the destroy operation only.
This method requires the sysOAuthGrantDestroy permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:OAuthGrant/set", { "destroy": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:OAuthGrant/query
Section titled “x:OAuthGrant/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysOAuthGrantQuery permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:OAuthGrant/query", { "filter": { "accountId": "id1" } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'The x:OAuthGrant/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):
| Condition | Kind |
|---|---|
accountId | id of Account |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get OAuthGrant id1stalwart-cli query OAuthGrantstalwart-cli query OAuthGrant --where accountId=id1Delete
Section titled “Delete”stalwart-cli delete OAuthGrant --ids id1OAuthClientKind
Section titled “OAuthClientKind”| Value | Label |
|---|---|
registered | Registered by an administrator |
dynamic | Registered dynamically (unverified) |
metadataDocument | Client ID Metadata Document (unverified) |
firstParty | Web application of this server |
OAuthScope
Section titled “OAuthScope”| Value | Label |
|---|---|
mail | Mail (IMAP, POP3, SMTP submission, ManageSieve, JMAP Mail) |
contacts | Contacts (CardDAV, JMAP Contacts) |
calendars | Calendars (CalDAV, JMAP Calendars) |
files | Files (WebDAV, JMAP File Storage) |