GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - VWS-Python/vws-auth-tools: Helpers for making applications which authenticate with Vuforia Web Services

This repository was archived by the owner on Oct 30, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

3,875 Commits
3,875 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.vscode
.vscode
 
 
docs
docs
 
 
newsfragments
newsfragments
 
 
src/vws_auth_tools
src/vws_auth_tools
 
 
styles/snapper
styles/snapper
 
 
tests
tests
 
 
.git_archival.txt
.git_archival.txt
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.prettierrc
.prettierrc
 
 
.vale.ini
.vale.ini
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODE_OF_CONDUCT.rst
CODE_OF_CONDUCT.rst
 
 
LICENSE
LICENSE
 
 
README.rst
README.rst
 
 
conftest.py
conftest.py
 
 
prek.toml
prek.toml
 
 
pyproject.toml
pyproject.toml
 
 
spelling_private_dict.txt
spelling_private_dict.txt
 
 
zizmor.yml
zizmor.yml
 
 

Repository files navigation

Build Status PyPI

VWS Auth Tools

Important

This project is archived because PTC is retiring the Vuforia Engine Cloud Image Recognition service on May 2, 2027. Existing customers can continue using the service until that date. After that date, Cloud Image Recognition databases and associated services will no longer be available.

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.

About

Helpers for making applications which authenticate with Vuforia Web Services

vws-python.github.io/vws-auth-tools/

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.