Skip to content

mock-oidc

mock-oidc is a standalone, container-first mock OIDC/OAuth2 authorization server for testing only. It mints real, cryptographically-signed tokens for arbitrary identities, so a test suite can drive a full sign-in against an unmodified OAuth2/OIDC client with no real identity provider. It is a Go reimplementation of navikt/mock-oauth2-server, is DB-less, and boots with zero configuration.

For testing only

mock-oidc signs a token for any identity on request and never validates client secrets. It must never front production traffic; the server logs a "FOR TESTING ONLY" banner on every startup.

30 seconds to a token

The server needs no configuration. Run the published container, read discovery for the zero-config default issuer, and mint an access token:

docker run --rm -p 8080:8080 ghcr.io/meigma/mock-oidc

# Discovery for the "default" issuer (materializes on first touch)
curl -sS http://localhost:8080/default/.well-known/openid-configuration
#   => {"issuer":"http://localhost:8080/default", ...}

# client_credentials grant — client secrets are never validated
curl -sS -X POST http://localhost:8080/default/token \
  -d grant_type=client_credentials \
  -d client_id=test-client \
  -d scope=api
#   => {"token_type":"Bearer","access_token":"eyJ...","expires_in":3600, ...}

Find your way

This site follows the Diátaxis framework. Pick the section that matches what you need right now.

Support and security