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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for affinidi_tdk_auth_provider-1.35.0.tar.gz
Algorithm Hash digest
SHA256 80a6733e5c8ebb69f6e1270b10838a13bf3846f95d37e29733baed5a39858b97
MD5 13226327ba835109762d6714239b0649
BLAKE2b-256 71c407fc79db2658aab752d76db6542ec51adcba77a078f8adc956bb86c37d31

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for affinidi_tdk_auth_provider-1.35.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09aa9b46f4d24165ebd8b60ee78406d418d2025f9f10a190875ab196c9697136
MD5 ff838840d279e727e986a65c6f62a9a6
BLAKE2b-256 96a1dab58825a93a33e956d3d18c1518367ee639c737617ba673b319047f3d68

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