Skip to main content

Build Status PyPI

VWS Auth Tools

Authentication and authorization tools for interacting with the Vuforia Web Services (VWS) API.

Installation

pip install vws-auth-tools

This is tested on Python 3.14+.

Usage

VWS and Query APIs

"""Make a request to the VWS API."""

import os
from http import HTTPStatus
from urllib.parse import urljoin

import requests

from vws_auth_tools import authorization_header, rfc_1123_date

access_key = os.environ["VWS_SERVER_ACCESS_KEY"]
secret_key = os.environ["VWS_SERVER_SECRET_KEY"]
request_path = "/targets"
content = b""
method = "GET"
formatted_date = rfc_1123_date()
authorization_header_value = authorization_header(
    access_key=access_key,
    secret_key=secret_key,
    method=method,
    content=content,
    content_type="",
    date=formatted_date,
    request_path=request_path,
)

headers = {
    "Authorization": authorization_header_value,
    "Date": formatted_date,
}

response = requests.request(
    method=method,
    url=urljoin(base="https://vws.vuforia.com", url=request_path),
    headers=headers,
    data=content,
    timeout=30,
)

assert response.status_code == HTTPStatus.OK, response.text

Model Target Web API

The Model Target Web API authenticates with OAuth2 client credentials rather than the VWS signature scheme. This package builds the HTTP Basic header for the POST /oauth2/token request and the Bearer header for the dataset endpoints; making the token request, and caching the returned token, are left to you.

"""Build authorization headers for the Model Target Web API."""

import os

from vws_auth_tools import (
    basic_authorization_header,
    bearer_authorization_header,
)

client_id = os.environ["VWS_MODEL_TARGET_CLIENT_ID"]
client_secret = os.environ["VWS_MODEL_TARGET_CLIENT_SECRET"]

token_request_headers = {
    "Authorization": basic_authorization_header(
        client_id=client_id,
        client_secret=client_secret,
    ),
    "Content-Type": "application/x-www-form-urlencoded",
}

# Sending ``grant_type=client_credentials`` to ``POST /oauth2/token``
# with those headers returns JSON with an ``access_token`` item.
access_token = "eyJhbGciOiJtb2NrIn0.e30.example-signature"  # noqa: S105

dataset_request_headers = {
    "Authorization": bearer_authorization_header(
        access_token=access_token,
    ),
}

assert token_request_headers["Authorization"].startswith("Basic ")
assert dataset_request_headers["Authorization"].startswith("Bearer ")

Full Documentation

See the full documentation.

Metadata

Release files for vws-auth-tools 2026.10.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vws-auth-tools 2026.10.9
File Size Uploaded
vws_auth_tools-2026.10.9.tar.gz 28.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vws-auth-tools 2026.10.9
File Interpreter ABI Platform
vws_auth_tools-2026.10.9-py3-none-any.whl Python 3 none any Details

Total release size: 34.0 kB

Release files / vws_auth_tools-2026.10.9.tar.gz

Download URL vws_auth_tools-2026.10.9.tar.gz
Size 28.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ad4c94e56c6313e79208fc9f2254b43ef524f9f9680481e95fe73f03de255bb9
BLAKE2b-256 checksum
How to use checksums
543080afaf63cb8bc8335dc11b604aff1311672f52d188b2775b2c59a58cc35b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / vws_auth_tools-2026.10.9-py3-none-any.whl

Download URL vws_auth_tools-2026.10.9-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a9e27c49ac5841d870c7f94c35eaaea91f78dcb5f2f4cc8a3417fcab71241b1
BLAKE2b-256 checksum
How to use checksums
4c8e778694f54dd9cdb208db54fa649a50b117e78b9d7bcb81597dd084672328
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page