Documentation
¶
Overview ¶
Command oauth2 backs the snippets on the doc-site "OAuth2 access-code (Google)" recipe page (usage/examples/auth/oauth2-access-code.md).
The runtime only enters the OAuth2 access-code dance on the protected-route side: a Bearer authenticator validates the inbound access token via an introspection helper. The /login and /auth/callback handlers are plain redirect/exchange handlers that live in user code.
External dependencies on `golang.org/x/oauth2` and `coreos/go-oidc` are deliberately not imported here — they are illustrative of *user* wiring, not of the runtime API. The OAuth2 client and userinfo validator are stubbed at package level so the snippet itself shows real runtime calls without bloating the doc-examples module with auth provider SDKs.
`go run .` exercises the demo wiring against a no-op spec.