Introduction to Connect
Use Connect to link to your users’ accounts
Introduction
- Connect is the client-side component that your users will interact with in order to link their accounts to Gandalf and allow you to access their data.
- Connect will handle credential validation, multi-factor authentication, and error-handling for every service that Gandalf supports. You can use Connect in any kind of application (web or mobile) - it’s as simple as just adding a link to your app.
- Connect is an App Clip & Instant App. These let users enjoy native app experiences without the need to download a full app. Learn more on Apple Developers & Android Developers
To try Connect, check out the Heimdall Example.
Connect Flow
The diagram below shows how Connect is used to obtain a dataKey
, which is used server-side to request data.
The flow begins when your user wants to link their account/data to your application.
- Open Connect for your users by navigating to the Connect URL. Pass your
publicKey
,redirectUrl
and the data source(s) you want to read data from. - After your user is done linking their account(s), Connect will navigate to your
redirectUrl
with a query parameter calleddataKey
. - This
dataKey
will be used to make requests to the Sauron API
Connect Helper Package
We provide packages to make it easy to generate a valid Connect URL. The Connect helper handles parameter validations automagically!
Install Using Swift Package Manager in Xcode
- Open your project in Xcode.
- Go to
File
>Add Packages...
. - Enter the repository URL:
https://github.com/gandalf-network/connect-ios-sdk.git
. - Choose the version rule (e.g., “Up to Next Major”) and click
Add Package
. - Select the GandalfConnect package for your target.
Or Update Package.swift
Then, run swift package update
to fetch the dependency.
Usage
Import the package
Initialization
Create an instance of ConnectInput
with the necessary details:
Initialize the Connect
class:
Generating URL
To generate a URL, call the generateURL
method:
Read more on Github.
Get Data Key
After your user is done linking their accounts, Connect will navigate to your redirectUrl
with a query
parameter called dataKey
.
You can use the packages to get the dataKey
easily.
Proceed by sending the dataKey to your server, where you can securely request the data you seek.
dataKey
directly
from your application’s server.