Overview
This node manages iFood authentication tokens by interacting with a database to perform operations such as cleaning up expired tokens. It supports multiple database types including MySQL, PostgreSQL, SQLite, and MongoDB. The 'Cleanup Expired Tokens' operation deletes tokens from the specified database table or collection that have expired, helping maintain a clean and efficient token store. This is useful in scenarios where token management and security are critical, such as automated workflows that require valid authentication tokens for iFood API access.
Use Case Examples
- Automatically remove expired iFood tokens from a MySQL database to prevent unauthorized access.
- Schedule a workflow to clean up expired tokens in a MongoDB collection to maintain database hygiene.
Properties
| Name | Meaning |
|---|---|
| Database Connection | Type of database to connect to for token storage and management (MySQL, PostgreSQL, SQLite, MongoDB). |
| Database Host | Hostname or IP address of the database server (not applicable for SQLite). |
| Database Port | Port number for the database connection, varies by database type (MySQL: 3306, PostgreSQL: 5432, MongoDB: 27017). |
| Database Name | Name of the database where tokens are stored. |
| Database User | Username for authenticating with the database (not applicable for SQLite). |
| Database Password | Password for authenticating with the database (not applicable for SQLite). |
| Database File Path | File path for SQLite database file (only applicable for SQLite). |
| Table/Collection Name | Name of the table or collection in the database where tokens are stored. |
| Client Identifier | Unique identifier for the client or application to filter tokens; if empty, the clientId from credentials is used. |
Output
JSON
operation- The operation performed, e.g., 'cleanup'.success- Boolean indicating if the operation was successful.timestamp- ISO timestamp when the operation was performed.clientId- Client identifier used for the operation.message- Informational message about the cleanup operation.deletedCount- Number of expired tokens deleted from the database.
Dependencies
- Requires an API key credential for iFood API authentication.
- Requires database access credentials for the selected database type.
Troubleshooting
- Ensure the correct database driver packages are installed for SQL or MongoDB operations; missing drivers will cause errors.
- Verify database connection parameters (host, port, user, password, database name) are correct and accessible.
- Check that the specified table or collection exists in the database.
- If the client identifier is not provided, the node uses the clientId from the iFood API credentials; ensure this is set correctly.
- Common error messages include 'Unsupported database connection' if an unsupported database type is selected, and 'Failed to cleanup expired tokens' if the database operation fails.
Links
- iFood API Authentication Documentation - Official documentation for iFood API authentication and token management.