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.

Prerequisites

Ensure you have the following installed:

  • Node.js v20.x or later

    💡 Node.js v20 is supported, but the LTS (Long Term Support) version is recommended for better stability and performance. For details on current LTS version check Node.js releases page.

  • npm v11.6.0+ (Node.js package manager)

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.34.0.tar.gz (1.5 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.34.0-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for affinidi_tdk_auth_provider-1.34.0.tar.gz
Algorithm Hash digest
SHA256 0c980dfa088a67986525111a7e92c8a730d5ff06b3b2ecaf7bf5256bb9964cd1
MD5 7c38ea84cc90790a93e28e1ea62d2a2d
BLAKE2b-256 0c097739c9352a84d0aa22e7d073b93f048fb1233fcc573b1aba01d3f6b76146

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for affinidi_tdk_auth_provider-1.34.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4880a9252cda9b6077a584bb9d6f7c2df3eddbf87e5cbad66911ad44b975dff3
MD5 f7b3d694a4b054d8f58155dcddb04f2e
BLAKE2b-256 507449959579b197f5fa0d089e2303fb16754560dc66eb45a6232f103d44ebee

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