oidc-auth

command
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

README

OIDC/JWT Authentication

This example demonstrates how to configure an HTTP server with OpenID Connect (OIDC) and JWT authentication.

Running the Example

go run github.com/dioad/net/examples/oidc-auth

Or build and run:

cd examples/oidc-auth
go build
./oidc-auth

Then test with a valid OIDC token:

curl -H 'Authorization: Bearer <your-token>' http://localhost:8080/secure

What It Demonstrates

  • Creating an OIDC validator configuration
  • Setting up GitHub Actions OIDC authentication
  • Using OAuth2 validator as global middleware
  • Token validation for protected endpoints

Code

See main.go for the complete executable example.

Documentation

Overview

Command main demonstrates wrapping an HTTP server with OIDC token validation middleware.

Jump to

Keyboard shortcuts

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