Skip to main content

This library provides utility methods to generate and sign Knox Cloud Tokens using python.

Project description

BuildStatus PyPI Version Active branch

KnoxTokenLibrary-Python ('PyKTL')

This is not an offical Samsung library or repository

pyktl is a python rewrite of the knox-token-library-js library written by Samsung. The following code was used to build this project. https://www.npmjs.com/package/knox-token-library-js?activeTab=readme

Usage

Install using:

pip install PyKTL

Assumptions

  • You have downloaded the Knox Certificate file (certificate.json)
  • You have generated a Client Identifier (api-key) for accessing apis of Knox Cloud Services.

Intended Use

The workflow for making api calls to Knox Cloud Services is divided into a portal workflow, and a programmatic workflow.

Portal flow

  • Download Certificate from Knox Api Portal
  • Generate and Download ClientIdentifier (api-key) for a specific Knox Solution

Programmatic flow

  • Call Knox api to generate an Api Access Token. This api call requires a signed ClientIdentifier, and specific contents of your Certificate (Public Key).

  • Call Knox api for your intended workflow (eg: upload device, configure device etc). This api call requires your signed Api Access Token, and specific contents of your Certificate (Public Key).

  • This utility py library helps generate signed clientIdentifiers, and signed accessTokens.

Examples

Leverage examples from here.

The example leverages a keys.json which is obtained using the SamsungKnox.com portal - view the Samsung tutorial for more details. The example also leverages clientId.json which includes the clientIds

{
    "kme": "",
    "kc": "",
    "ke1": "",
    "kai": ""
}

You can also reference Samsung's authentication tutorail found here: https://docs.samsungknox.com/dev/knox-cloud-authentication/tutorial/tutorial-for-customers-generate-access-token/. I did attempt to keep only required method names, so not all methods found in the nodejs/java/NuGet package will be available in PyKTL.

Local Build & Install

In order to build and install pyktl locally you can run the following commands:

python setup.py sdist
pip install .

KDP API Support

While no testing was done using the PyKTL and the Knox Deployment Program API - it is believed it should still work. Authentication between the KCS APIs and KCS APIs appears to be the same.

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

PyKTL-0.3.8.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

PyKTL-0.3.8-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file PyKTL-0.3.8.tar.gz.

File metadata

  • Download URL: PyKTL-0.3.8.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for PyKTL-0.3.8.tar.gz
Algorithm Hash digest
SHA256 0ab08c7a38bd56583f6ef923a2eb9ea5d19c326f48d5c8d8b7635c13616308eb
MD5 faf98dbde58c25f00344dc340024fb19
BLAKE2b-256 c2ab778aad2c3d82afea5538d0b7a6c727a316d64224999cd29cc0205854765d

See more details on using hashes here.

File details

Details for the file PyKTL-0.3.8-py3-none-any.whl.

File metadata

  • Download URL: PyKTL-0.3.8-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for PyKTL-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 dd3e68d6d8c3862aba0b4dd880fd1a3e8e43c7242e32772b5da84841fa1a63dd
MD5 9f15cd34692ea3fc7dad05d3175aa9d7
BLAKE2b-256 c8c83e0ebf395ad1e1b41d34c7dd93be80f44d3de0273e1544cf2007f0bceb78

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