Signup, login and profile with the Python SDK (authorizer-py 0.2.0) sync client, plus an admin query listing users.
git clone https://github.com/authorizerdev/authorizer.git
cd authorizer
make dev # http://localhost:8080, admin secret: adminpython -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python main.pyDefaults match make dev; override with AUTHORIZER_URL, CLIENT_ID, ADMIN_SECRET env vars.
- The pip package is
authorizer-py; the import isauthorizer. - The client supports three wire protocols:
graphql(default),rest, andgrpc(AuthorizerClient(..., protocol="grpc"); gRPC needspip install 'authorizer-py[grpc]'). - Async variants exist for both clients:
AsyncAuthorizerClient,AsyncAuthorizerAdminClient. - Admin operations authenticate with the
x-authorizer-admin-secretheader, normally viaAuthorizerAdminClient.
Two things this example works around, both fixed by an SDK release rather than by the example:
- No
skip_mfa_setup. Since server 2.4.0 MFA is on by default, so signup/login withhold the access token and returnProceed to mfa setup; declining the offer is what releases the token. The SDK has no typed call for it, somain.pygoes through thegraphql_queryescape hatch. The call is identified by the MFA session cookie, which the server marksSecure— httpx keeps it in its jar but will not replay it over plainhttp, so the example passes it by hand. - Paginated admin queries are rejected by a 2.4.0 server.
AuthorizerAdminClient.users()still sends$data: PaginatedRequest, a type the server renamed toListUsersRequest, so it fails withUnknown type "PaginatedRequest".verification_requests(),webhooks()andemail_templates()have the same drift.main.pyissues the_usersquery directly instead.