Auth Provider
Install Dependency
Package: affinidi_tdk_auth_provider
pip install affinidi_tdk_auth_providerCheck the latest version on the PyPI repository or view the source on GitHub. The Python package for
auth-provideris transpiled from the TypeScript version using JSII.
API Endpoints
URLs required to initiate integration with Affinidi TDK.
Token Endpoint
Endpoint to generate access token to call Affinidi Services with TDK.
https://apse1.auth.developer.affinidi.io/auth/oauth2/tokenAPI Gateway URL
Base API URL of Affinidi Services.
https://apse1.api.affinidi.ioClasses and Methods
AuthProvider API
Used to generate Project Scoped Token required for calling Affinidi services (Clients).
When initiating the AuthProvider class, provide the Token information including the public/private key information to generate the Authorisation Token required.
AuthProvider (constructor)
Initialises the AuthProvider with the Personal Access Token credentials required to generate authorisation tokens.
Parameters
tokenId
str
RequiredprivateKey
str
Requiredpassphrase
str
OptionalprojectId
str
RequiredExample
import affinidi_tdk_auth_provider
stats = {
'tokenId': tokenId,
'passphrase': passphrase,
'privateKey': privateKey,
'projectId': projectId,
}
authProvider = affinidi_tdk_auth_provider.AuthProvider(stats)fetch_project_scoped_token
Returns the generated project-scoped token for calling Affinidi services.
No parameters required.
Example
import affinidi_tdk_auth_provider
stats = {
'tokenId': tokenId,
'passphrase': passphrase,
'privateKey': privateKey,
'projectId': projectId,
}
authProvider = affinidi_tdk_auth_provider.AuthProvider(stats)
projectScopedToken = authProvider.fetch_project_scoped_token()create_iota_token
Creates an Affinidi Iota Framework token to generate Iota Credentials for signing the request token.
Parameters
iotaConfigId
str
Requireddid
str
RequirediotaSessionId
str
OptionalExample
import affinidi_tdk_auth_provider
stats = {
'tokenId': tokenId,
'passphrase': passphrase,
'privateKey': privateKey,
'projectId': projectId,
}
authProvider = affinidi_tdk_auth_provider.AuthProvider(stats)
iota_token = authProvider.create_iota_token('<IOTA_CONFIGURATION_ID>', '<LOGGED_IN_USER_DID>')Glad to hear it! Please tell us how we can improve more.
Sorry to hear that. Please tell us how we can improve.
Thank you for sharing your feedback so we can improve your experience.