Skip to content

Code snippets to facilitate integration with Hive Services using JWT

Notifications You must be signed in to change notification settings

hivestreaming/jwt-auth-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jwt-auth-examples

Code snippets repository to facilitate integration with Hive Services using JWT

Note

The snippets shown are a collection of necessary steps that need to be done to get authenticated by Hive

Warning

Requires Node version >= 18

Important

Prerequisite for using the code snippets - having received a partner ID and partner API token from Hive

Pre-requisites

Install dependencies:

npm install

Integration steps

Step 1

Create a private RSA key that will be used to encode the Json Web Token:

npm run generate-rsa-key

Alternatively you can also generate a key via openssl - see command:

npm run generate-rsa-key:openssl

Step 2

Publish the public RSA key that will be used by Hive to decode the JWT:

npm run public-key-post

Step 3

Create a JWT with manifest:

npm run create-jwt:manifest

Or create a JWT with regex:

npm run create-jwt:regex

Public RSA key management:

Scripts available for public RSA key management.

Publish key:

npm run public-key-post

Fetch key:

npm run public-key-get

List all stored keys:

npm run public-key-get-all

Delete (invalidate) key:

npm run public-key-delete

About

Code snippets to facilitate integration with Hive Services using JWT

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published