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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for affinidi_tdk_auth_provider-1.33.3.tar.gz
Algorithm Hash digest
SHA256 b0736889210d1c784dc7bc38d40fb6c3d2f81ff91a010f8d89299c66f43f39ab
MD5 d7991bcc09699976494b6be8655c8a71
BLAKE2b-256 52c4ce6b3fa7c322df6dc503cdea0479c48b884ac450b5a6de68de6755449a83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for affinidi_tdk_auth_provider-1.33.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8d3858bd2009438d0a18006b23a7e7f7b7371a1a9a1dbaa5d693dc55c9c2732d
MD5 15ef3cb6c0a74b6756c0e7ecebe53a92
BLAKE2b-256 3ec87b1af7aded905fdacbde11c4f0ad90c4822c180ce01fcbd03e025f5d4bb0

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