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.13+.
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vws_auth_tools-2026.8.16.tar.gz.
File metadata
- Download URL: vws_auth_tools-2026.8.16.tar.gz
- Upload date:
- Size: 27.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8058166e3715cdd407d3894e45c173d11034388accc1e57be847daf15255edb8
|
|
| MD5 |
5db158d71b6a5f606895251701899fa0
|
|
| BLAKE2b-256 |
5de7ada1334e67ca97158f59e486a885bf15e04188e03f243aeac79ab3c716dc
|
Provenance
The following attestation bundles were made for vws_auth_tools-2026.8.16.tar.gz:
Publisher:
release.yml on VWS-Python/vws-auth-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vws_auth_tools-2026.8.16.tar.gz -
Subject digest:
8058166e3715cdd407d3894e45c173d11034388accc1e57be847daf15255edb8 - Sigstore transparency entry: 2486329776
- Sigstore integration time:
-
Permalink:
VWS-Python/vws-auth-tools@927de6b9bd39ec98574673e06a732e9277f2ccc3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/VWS-Python
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@927de6b9bd39ec98574673e06a732e9277f2ccc3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file vws_auth_tools-2026.8.16-py3-none-any.whl.
File metadata
- Download URL: vws_auth_tools-2026.8.16-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1464b7db4bb467c4636d41bbf7d6a89f22241a2b66a23fa26ef9572933d475e2
|
|
| MD5 |
3d8b8893a9f2be0a63d544c69297382d
|
|
| BLAKE2b-256 |
fff3ec5bf9b75674bda643200fe8da42fed06ec76be2982ccf3edb8c49553332
|
Provenance
The following attestation bundles were made for vws_auth_tools-2026.8.16-py3-none-any.whl:
Publisher:
release.yml on VWS-Python/vws-auth-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vws_auth_tools-2026.8.16-py3-none-any.whl -
Subject digest:
1464b7db4bb467c4636d41bbf7d6a89f22241a2b66a23fa26ef9572933d475e2 - Sigstore transparency entry: 2486330139
- Sigstore integration time:
-
Permalink:
VWS-Python/vws-auth-tools@927de6b9bd39ec98574673e06a732e9277f2ccc3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/VWS-Python
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@927de6b9bd39ec98574673e06a732e9277f2ccc3 -
Trigger Event:
workflow_dispatch
-
Statement type: