How to connect with providers using a Magic Link

05 Jan, 2024

How to connect with providers using a Magic Link

How to connect with providers using a Magic Link

About

This tutorial will guide you through the steps of how to connect with agricultural technology providers via Leaf's Magic Link, a shareable URL that you can generate for your grower customers to authenticate with their providers. Magic Link enables your customers to authenticate with their preferred providers such as John Deere, Climate FieldView, CNHi, AgLeader, and Trimble. It doesn't require embedding into a frontend or app, meaning it's quick and easy to set up.

Note: If you'd prefer to embed a widget within your application, a Leaf Link widget is also available to you.

Why use Leaf Magic Link?

  • No need to build UI when connecting providers.
  • Use Leaf's pre-built infrastructure and build with farm data from one source.
  • Access clean, merged and standardized data from various agricultural providers once integrated.

Summary


1. Register for a Leaf account

First, you’ll need to register for a Leaf account. If you don’t yet have an account you can register below. Make sure to activate your account via the activation email.

Register with Leaf -->

2. Authenticate to access Leaf’s API

Next, you’ll need to authenticate by requesting your access token:

View documentation -->

3. Set up your provider(s)

Magic Link supports John Deere, Climate FieldView, CNHi, AgLeader, and Trimble as providers. In this step, you will need to configure the application information for each provider you wish to connect. This setup is required once, so if you already have the provider configured you can skip this step.

4. Customize the Magic Link

The Magic Link offers simple customizations to set up the link with your company branding. For this example, we use the following customizations:

The background color is green (hexadecimal code "#2ecc71"), the company name is "My Company" and the demo images as the header and logo.

View documentation -->

5. Creating the Magic Link for single-provider authentication

You can either generate a Magic Link for single provider authentication, or a Magic Link with multiple providers (see next step for multiple providers).

For the single provider authentication option, you can request your user to authenticate directly with a selected provider:

Aside from the settings filled in the previous steps, you can also configure the expiration time ('expiresIn') in seconds, the 'externalId', and the provider ('providerName'): JohnDeere, ClimateFieldView, CNHI, AgLeader, or Trimble.

'Leaf users' (equivalent to a grower account, which third party credentials get attached to), are automatically created during the Magic Link creation process. The 'externalId' is a unique identifier to help you organize 'Leaf users'; through the 'externalId' you are able to link a grower identification number or any control variable used in your platform.

The link created can be found in the 'link' property from the response, which you can redirect your user to.

View documentation -->

6. Creating the Magic Link for multiple-provider authentication

You can also generate a link that allows authentication with multiple providers:

That concludes this tutorial on how to get set up with Leaf Magic Link! If you have any further questions, please don't hesitate to send us an email at help@withleaf.io.

View documentation -->

Where to next?

--> Field Boundaries --> Manual File Upload --> Crop Monitoring --> Input Validator --> Back to 'for developers'

Ready to begin?

Get API Keys and Start Building Today!

Sign up for free account

Questions? Get in touch