skillfed

oidc-provider-mock

OpenID Connect provider server for testing authentication

oidc-provider-mock v0.4.6 98.8K downloads/30d#13,060 on PyPI42
Permissive license MIT Active released

What it is and what it does

oidc-provider-mock is a lightweight OpenID Connect provider server designed for local testing and development. It runs as a standalone server (via CLI or Docker) or embedded in test code, accepting any client ID and secret by default and providing a simple HTML login form where you can specify the authenticated user. You configure it as your OIDC issuer URL in your application, then use its HTTP API to set up test users and claims before running authentication flows.

The package is built on Flask, uvicorn, authlib, and joserfc, and is intended for integration tests and end-to-end test suites—not for production. It lets you test OIDC flows (authorization code, implicit, etc.) without external dependencies, and supports custom claims and error simulation to cover edge cases in your authentication logic.

Use it for:

  • Integration testing of OIDC client libraries (e.g., Flask-OIDC) in CI/CD pipelines without external provider setup.
  • End-to-end testing of login flows in web apps using Playwright or similar tools with a controllable mock identity provider.
  • Local development of multi-tenant or federated authentication systems where you need to simulate different user identities and claims.
  • Testing error handling and edge cases in OIDC flows (e.g., denied authorization, malformed tokens) in a controlled environment.
  • Rapid prototyping of authentication UX before integrating with a real identity provider.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A mock OpenID Connect provider server that runs locally to test and develop OpenID authentication flows without needing a real identity provider.

Yes, if you are testing or developing OIDC-based authentication. The package is actively maintained, has no known vulnerabilities, installs easily, and solves a real testing problem. The Python version mismatch (classifiers vs. requires_python) should be clarified before use, but the core functionality is sound for test environments.

Install

oidc-provider-mock on PyPI

pip

pip install oidc-provider-mock

uv

uv add oidc-provider-mock

poetry

poetry add oidc-provider-mock

Installing oidc-provider-mock

Before you install

Low friction install with a pure Python wheel. Active maintenance—last commit 2026-08-14, released 2026-06-29. Supports Python 3.8 through 3.11, though the package requires Python >=3.12.

License in practice

MIT license (permissive). You can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pipx run oidc-provider-mock
# Or in code:
import oidc_provider_mock
with oidc_provider_mock.run_server_in_thread() as server:
    issuer_url = f"http://localhost:{server.server_port}"

Requires Python >=3.12; the package classifiers list 3.8–3.11 support but the metadata specifies 3.12 as the minimum.

Verify before relying

  • Whether the Python 3.8–3.11 classifiers reflect actual tested support or are outdated given the >=3.12 requirement.
  • Performance characteristics under load (e.g., concurrent test sessions or high-frequency user provisioning).
  • Whether custom claims and error simulation cover all OIDC flows needed for your use case.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.12)
Install friction low — pure-Python wheel
Runtime dependencies 9 — authlib, flask, htpy, httpx, joserfc, pydantic, pyyaml, typing-extensions, uvicorn
Maintenance actively maintained — 46 days since the last release
Last repo commit
First released
Downloads 98,780/month — #13,060 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: oidc_provider_mock-0.4.6-py3-none-any.whl

Keywords: OAuth, OIDC, OpenID Connect, authentication, development, mock, testing

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP :: HTTP ServersTopic :: SecurityTopic :: Software Development :: TestingTopic :: Software Development :: Testing :: Mocking

Tags

openid connect mock serveroidc testing provideroauth2 mock authenticationlocal identity provider testingoidc development servermock oidc providertest openid connect flows
oidc-testingmock-serverauth-development

More Testing packages