On each Uni Node, users can access the underlying resources - data, files, etc. through a GraphQL API with HTTPS transport. Vendia allows node owners to control the API access and usage through API settings.
To enable programmatic server-to-server access to the Node, Vendia provides the ability to dynamically create an unlimited number of API Key(s). An API Key may optionally have an expiration if the data access use-case is timebound.
Note: API Keys are secrets and should be stored securely. The API Key is only viewable at the time of creation.
Creating an API Key in Vendia
In order to create an API Key via the Vendia Console:
Navigate to your Uni landing page.
Choose the Node for which you would like to add an API Key and select “Manage Node” to navigate to Node settings.
Select “Authorization”
Click “Add API Key”.
Creating an API Key via GraphQL mutation
API Keys can also be created via the GraphQL Explorer or programmatically (if you have already have a key configured).
Creating an API Key via the CLI
To learn how to set up the Vendia Share CLI see our CLI docs
Using an API Key
GraphQL API
The API Key should be sent via the Authorization header of each GraphQL request
GraphQL WebSocket API
The API Key should be sent in the first message after connecting to the WebSocket
With the Vendia SDK
JWT Authentication
JSON Web Tokens (JWT) are an open, industry standard RFC 7519 method for representing claims securely between two parties. Enabling JWT Authentication for your Vendia Node allows for both client-to-server and server-to-server access. With this authentication method, you specify your external identity provider’s public key details so that the Node can validate the incoming token.
Gathering your Provider’s public key details
In order to configure JWT Authentication, you will need to gather some information from your preferred identity provider. Common identity providers include:
Okta
Auth0
AWS Cognito
Azure Active Directory
You will need to provide the following information from your identity provider:
JSON Web Token Key Set (JWKS) URL
The JSON Web Key Set (JWKS) is a set of keys containing the public keys used to verify any JSON Web Token (JWT).
The “aud” (audience) claim identifies the recipients for whom the JWT is intended.
Tip: This value is typically customizable and unique per application that is associated with your identity provider.
Examples:
Okta -> api://{my-app}
Auth0 -> https://{my-app-domain}
Scopes (Optional)
The “scope” claim identifies the custom resources to which your JWT has access.
Tip: OIDC Standard scopes include: openid, profile, email
Creating JWT Authentication in Vendia
In order to setup JWT Authentication via the Vendia Console:
Navigate to your Uni landing page.
Choose the Node that will have JWT Authentication and select “Manage Node” to navigate to the Node settings.
Select “Authorization”
Click “Add JWT”
Create JWT Authentication via GraphQL
JWT Authentication can also be created via the GraphQL Explorer or programmatically (if you have already have a different authentication method configured).
Using JWT Authentication
GraphQL API
The JWT should be sent via the Authorization header of each GraphQL request, using the Bearer prefix
GraphQL WebSocket API
The API Key should be sent in the first message after connecting to the WebSocket
With the Vendia SDK
API Credentials
API Credentials allow you to programmatically access both the Vendia Control Plane API (e.g. for listing and creating Unis) and Node APIs. Vendia API Credentials implement the OAuth Client Credentials flow and which exchanges the credentials for a short-lived access token.
To get started, navigate to your Organization page and select API Credentials in the left nav.
Click Create API Credentials and you can then specify a name, expiration, and role for your API Credentials.
After clicking the Save button you’re presented with your Client ID and Client Secret, as well as instructions on how to use them with the Vendia SDK.
If you’re not using the Vendia SDK, you can use the following flow to exchange your Client Credentials (Client ID and Client Secret) for an Access Token that can then be used to Access the Vendia APIs. For the best performance, cache your Access Token and only refresh it when it’s expired or close to expiring.