Email access token credentials
Description
Pure function: builds an email credentials object from an OAuth2 access token you already have, authenticating with SASL XOAUTH2. Use this when the token comes from a flow the Email OAuth2 credentials node cannot run itself — for example an authorization-code grant whose refresh token you exchange with an HTTP request node. The token is used as supplied and is never refreshed.
When to use
Use this when Email OAuth2 credentials cannot get the token for you. The usual reason is a provider that only supports a delegated flow: the user consented once through a browser, you hold a refresh token, and each run has to exchange it for a fresh access token.
Do that exchange with an HTTP request node against the provider’s token
endpoint, parse the JSON response, and wire the access_token field into
this node. Keep the refresh token in a secret variable and write the new one
back with Set variable if the provider rotates it.
Prefer Email OAuth2 credentials whenever the client credentials grant is an option — it caches tokens and handles expiry for you. This node exists so an unusual provider never becomes a blocker.
Pins
Input pins
| Pin | Type | Default | Notes |
|---|---|---|---|
| Host | string | — | IMAP hostname of the mail server. |
| Port | integer | — | IMAP port. `0` selects the encryption default (993 for `SSL_TLS`). |
| Username | string | — | The mailbox the token grants access to, as a full email address. |
| Access token | string | — | A currently valid OAuth2 access token, without the `Bearer ` prefix. It is sent as supplied and never refreshed — an expired token fails the connection on the error branch. |
| Encryption | Email encryption | SSL_TLS | Almost always `SSL_TLS`. |
Output pins
| Pin | Type | Notes |
|---|---|---|
| Credentials | Email credentials | Opaque credentials object, interchangeable with the other two credential nodes' output. |
Example
Read a mailbox at a provider that only issues delegated tokens. Store the
refresh token in a secret variable. Use HTTP request to POST it to the
token endpoint, Stream to string plus Parse to model to pull access_token
out of the response, then wire that string into this node’s Access token
along with Host imap.provider.com and the mailbox address. Feed
Credentials into Find emails.