oauth2

command
v0.33.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL