Authenticating Apps

Jump to:

OFN API

SendGrid

# Gmail

#Send Email Module

#Airtable

OFN API

The best way to link the OFN API with N8N is using API key.

If you are an instance manager, create a different set of credentials for every enterprise for whom you create a workflow, using the API of an associated user that has the enterprise permissions for the workflow you are creating. For example, if you want to create a stock report for the products of a food hub, use the API key of a user that has permission to manage all of the products that you expect the report to contain. This means that you'll repeat this process for every enterprise for whom you create a workflow.

If you are a developer or working with a specific food enterprise and you don't have an API key you'll need to contact the Instance Manager of the instance you are hoping to query via the API.

We strongly recommend you never use a Super Admin API key in N8N as accessing the API with this user runs the risk of opening security vulnerabilities and introducing performance issues on production servers.

To add OFN API authentication to N8N:

  • Go to Credentials -> New

  • Create a 'Header Auth' authentication type (for V0 API) or a 'Query Auth' Authentication (for V1 API)

  • Name your authentication after the access credentials eg the name of the food hub that the API has permissions on

  • For V0 API: Name: X-Spree-Token Value: [your API key from OFN]

  • For V1 API: Name: token Value: [your API key from OFN]

SendGrid

You'll need to have an existing SendGrid account that you can link.

N8N have created a helpful video and instructions for this :)

Gmail

You'll need to have an existing Google Cloud account that you can link to. Your first step is to set up your Google service nodes authetication, using either the OAuth2 or Service Account (the majority of Google services nodes are compatible with OAuth2 authentication).

N8N have created a helpful video and instructions to help you through the setup process.

Send Email Module

You can also use this module to send emails by creating a SMTP connection with your email account. Configuration steps are for Gmail accounts, but can be tweaked for other non-gmail accounts. Steps for setting up the module:

Credential for SMTP connection (gmail account): Create New

  • User: Email address to be connected

  • Password: App password, NOT your gmail password

  • Host: “smtp.gmail.com” (will be different if you are using a non-gmail account)

  • Port: 465

  • Creating APP password for a Gmail account:

    • Make sure you have 2-Factor Authentication on for the account (its required for getting the App password)

    • Go to Manage your account → Security →Signing in to Google →App passwords

    • Then generate an App password, chose “Mail” for App, and “Custom” or “Others” for the device, then use ”n8n” for the name

    • After this, it will show you the generated password. Make sure you copy the app password as you won’t be able to see it again. You will only be able to delete it. This will be your APP password for the Send Email SMTP connection.

From Email: use the same email address you have just connected

Attachments: When using it after the spreadsheet module use the name of the binary property found in the spreadsheet module (usually its “data”)

Airtable

To set-up an airtable connection in n8n, you will need your airtable API key.

To get the API key, click on the account icon on top-right corner and then go to account→overview→API → Generate API key (if you don’t have one)

Note: Connection with this API key will have read-write-delete access to all the bases in your airtable workspace. If you want to limit that, then you can look up the instructions to create read-only API key for you account (link is in the API section of the accounts page)

For any operation in Airtable, you will need Base ID/URL, Table ID/URL, and View (optional)

Base Id/URL: Open the required base and table in Airtable and just copy the URL into the base URL field.

Table Id/URL: You can use the same URL for table URL field also (given you have opened the correct table when you copied the URL).

View: Exact name of the view

Note: When adding data to airtable, make sure the name & type of the field you are adding the data from and the name & type of the field in airtable are same, otherwise it will give you an error. You can use “Set” module to change the incoming variable name and type within the workflow.

Nextcloud

Using OAuth:

  1. In N8N, add credential "NextCloud OAuth2 API" so you get the OAuth Redirect URL

  1. In your Nextcloud account (you must be an administrator to access these security settings). Go to 'Settings' > 'Security'. Under OAuth2, Add client:

Name : n8n

Redirection URI: add the OAuth Redirect URL (see step 1)

  1. In N8N, fill in the fields as following (replace coopcircuits.fr by your instance):

Authorization URL * https://nextcloud.coopcircuits.fr/index.php/apps/oauth2/authorize

Access Token URL * https://nextcloud.coopcircuits.fr/index.php/apps/oauth2/api/v1/token

Client ID * the ID given to you in Nextcloud

Client Secret * the secret given to you in Nextcloud

Web DAV URL (⚠️ it's not the DAV url you get in Nextcloud): http://nextcloud.coopcircuits.fr/remote.php/webdav

Connect to your account 🎊

Last updated