Skip to main content

Internal module for managing access tokens

Project description

@affinidi-tdk/auth-provider

Affinidi TDK internal module for managing access token (project scoped token) to Affinidi services via Affinidi TDK clients.

Pre-requisites

To initialize AuthProvider, Personal Access Token (PAT) details should be provided. To create PAT, use Affinidi CLI's create-token command.

affinidi token create-token -n MyNewToken -w -p YOUR-SECRET-PASSPHRASE

This command will return you variables to initialize AuthProvider.

Install

Javascript

npm install @affinidi-tdk/auth-provider

Python

Install Python package

run inside python virtual env

pip install affinidi_tdk_auth_provider

Usage

Python package usage

import affinidi_tdk_auth_provider

stats = {
  keyId,
  tokenId,
  passphrase,
  privateKey,
  projectId,
}

authProvider = affinidi_tdk_auth_provider.AuthProvider(stats)

projectScopedToken = authProvider.fetch_project_scoped_token()

Javascript package usage

import { AuthProvider } from '@affinidi-tdk/auth-provider'

const authProvider = new AuthProvider({
  keyId,
  tokenId,
  passphrase,
  privateKey,
  projectId,
})

const projectScopedToken = await authProvider.fetchProjectScopedToken()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

affinidi_tdk_auth_provider-1.33.2.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

affinidi_tdk_auth_provider-1.33.2-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file affinidi_tdk_auth_provider-1.33.2.tar.gz.

File metadata

File hashes

Hashes for affinidi_tdk_auth_provider-1.33.2.tar.gz
Algorithm Hash digest
SHA256 1062f1a439355a344e1267f85a9ae4fce213d82288e24896f88c8ad2bdd006f3
MD5 bd6c04c7c288df7c9695cf493d425416
BLAKE2b-256 dc6baa454daca3d15ad2ea612a54181a62df647a762105b1fcfd295aca70a1b1

See more details on using hashes here.

File details

Details for the file affinidi_tdk_auth_provider-1.33.2-py3-none-any.whl.

File metadata

File hashes

Hashes for affinidi_tdk_auth_provider-1.33.2-py3-none-any.whl
Algorithm Hash digest
SHA256 87173f8fdc5746a7b06e3966877b6371bb10671f0fc6ab6da8852cf57a825e94
MD5 8715f072fd667c9971dc900348719305
BLAKE2b-256 63fa8b5a3fab8c6908cfe7afe569449255c6e183b9843342d412d9305813f158

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page