How zitadel/oidc works
Project type and purpose
• This is an OpenID Connect (OIDC) SDK for Go: a library/toolkit that provides both a Relying Party (RP/client) and an OpenID Provider (OP/server) implementation.
• It’s not a standalone app but a modular framework, with a rich set of example programs illustrating real-world usage.
File structure
• Top-level packages:
• pkg/client → RP (relying party) and RS (resource server) code
• pkg/op → OP (OpenID Provider) server code (endpoints, flows)
• pkg/oidc → shared definitions & discovery logic
• pkg/crypto, pkg/http, pkg/strings → utility libraries
• example/ → runnable examples: client apps, resource servers, static & dynamic OP servers
• internal/ → test utilities (not part of public API)
• Configuration & CI: go.mod/sum, GitHub Actions, semantic-release, coverage & lint configs.
Key insights from the README
• Lists major package roles and supported OIDC/OAuth flows (code, PKCE, JWT profile, device auth, introspection, token exchange).
• Shows how examples wire up the SDK to real HTTP endpoints and HTML templates.
• Emphasizes semver, upgrade guide, certification goals.
Essential elements
• Storage interface boundary and example/server storage implementation.
• Detail pkg/client’s rp and rs modules, including JWT profile and introspection clients.
• Protocol steps (OAuth2 grant types, PKCE, device flow) where relevant.