Repository navigation
feat: send Auth0-Client and User-Agent headers on requests to Auth0 - #153
Merged
Merged
Conversation
Adds an Auth0-Client header (base64 JSON of name, version and env) and a User-Agent header to OIDC discovery, JWKS, Token Vault, token exchange, on-behalf-of and client credentials requests. Adds ApiClientOptions.client_info so a wrapper SDK can report its own name, version and env.
nandan-bhat
approved these changes
Nov 3, 2026
nandan-bhat
previously approved these changes
Nov 3, 2026
…document client_info Adds a custom_fetch test for discovery and JWKS, asserts the User-Agent header on every request kind, pins the client_info validation cases and messages, and stops the telemetry tests depending on the installed package. Documents client_info and custom_fetch in the docstrings and the README.
nandan-bhat
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Changes
This PR makes
auth0-api-pythonsend anAuth0-Clientheader and aUser-Agentheader on every request it makes to Auth0, so Auth0 can tell which SDK and version a request came from. It also adds aclient_infooption so a wrapper SDK built on this one can report its own name and version.✨ Features
name,versionandenv. The version is read from the installed package, and shows asunknownif the package metadata is not available.get_access_token_for_connection(),get_token_by_exchange_profile(),get_token_on_behalf_of()andget_client_credentials_token().ApiClientOptions(client_info={...})takes aname, aversionand an optionalenvdict. The wrapper is reported as the client, and this SDK's version and the Python version are added toenv.🔧 API Changes
client_infotoApiClientOptions. A malformed value raisesConfigurationErrorwhen theApiClientis created.User-Agent: Python/<version>in place of thehttpxdefault.custom_fetchis set, the headers are not added to discovery and JWKS requests, because the caller's function makes those calls.fetch_oidc_metadata()andfetch_jwks()take an optionalheadersargument, which is not applied whencustom_fetchis set.🧪 Testing
Contributor Checklist