🗝️API Key
Creating and managing tokens for your Pop
Overview
EyePop uses a standard OAuth system to manage access to your Pops.
In essence, OAuth is a token exchange and management protocol that allows you to create public temporary keys for your authenticated users. Depending on your Pop use case, a temporary key may or may not be necessary so let's explore the main use cases.
The primary Pop use cases are as follows:
Server to Server: You or a server talks directly to your Pop.
Server to Client: Your clients talks directly to your Pop - temporary keys are required.
Quick Start
In your Bash terminal, follow these steps get a temporary token:
Creating an API Key
Visit the dashboard:
Create a Pop and continue to Step 3
Select "Create API Key"
Enter a name in the popup modal for your key, select "Continue"
Copy this key, and store it locally on your machine - make sure to not share this publicly
Client Side Authentication
Enabling client side authentication with your Pop entails running your own server for your clients to request a temporary token from. This can simply be done by creating an HTTP endpoint, something like: mysite.com/api/eyepop/auth
, which checks if your client is authenticated - then returns a temporary token from the EyePop API.
The following is an AWS lambda function doing exactly this. In this example, your client could make an HTTP to this lambda and receive their token valid for a day. Feel free to modify to your platform of choice:
Developer SDK Authentication Flow
To get developers up and running faster, you can generate a token using the SDK Authentication workflow built into the dashboard via the JavaScript SDK. To do this, pass an empty string into the token
parameter of the FetchPopConfig
function and you will be prompted to allow a temporary token to be created as shown in the image below.
Last updated