The Go demo uses a JSON configuration file instead of environment variables.
cp config.example.json config.json
config.json with your client credentials from MrWhoOidc Admin UIconfig.json{
"issuer": "https://localhost:8443",
"client_id": "go-demo",
"client_secret": "your-client-secret-from-admin-ui",
"redirect_url": "http://localhost:5080/callback",
"scopes": [
"openid",
"profile",
"email",
"offline_access"
],
"use_pkce": true,
"listen_addr": ":5080"
}
| Field | Required | Default | Description |
|---|---|---|---|
issuer |
Yes | - | OIDC provider URL (e.g., https://localhost:8443) |
client_id |
Yes | - | Client ID from Admin UI |
client_secret |
Yes | - | Client Secret from Admin UI |
redirect_url |
No | http://localhost:5080/callback |
OAuth2 redirect URI |
scopes |
No | ["openid", "profile", "offline_access"] |
Requested scopes |
use_pkce |
No | true |
Enable PKCE for enhanced security |
listen_addr |
No | :5080 |
Server listen address |
docker compose up -d
Access Admin UI: https://localhost:8443/admin/clients
Login with the admin credentials created during bootstrap.
Navigate to Client Management → Create Client
go-demohttp://localhost:5080/callbackhttp://localhost:5080/openid, profile, email, offline_accessCopy the generated Client Secret
Update config.json with the client secret
go run main.go
You can specify a different configuration file using the MRWHO_GO_WEB_CONFIG environment variable:
export MRWHO_GO_WEB_CONFIG=/path/to/custom/config.json
go run main.go
config.json with real secrets to version controlconfig.json is included in .gitignoreconfig.example.json as a templateuse_pkce: true) for enhanced securityEnsure config.json exists and contains valid issuer and client_id values.
docker compose pshttps://localhost:8443config.json