Skip to content

Add oidcauth package - #48

Merged
firecow merged 2 commits into
mainfrom
add-oidcauth-package
Aug 5, 2026
Merged

Add oidcauth package#48
firecow merged 2 commits into
mainfrom
add-oidcauth-package

Conversation

@firecow

@firecow firecow commented Aug 4, 2026

Copy link
Copy Markdown
Member
  • Adds oidcauth package: authorization code flow with PKCE for browsers, bearer tokens for api clients, the verified id token as the session cookie, no session store
  • Register(mux) wires /auth/login, /auth/callback and /auth/logout; HandlerFunc(h, roles...) gates a handler on any of the roles, or on being authenticated when given none, and Middleware(roles...) is the same gate for chi
  • Roles are read from client_roles and resource_access.<client>.roles, so it suits cegos golang projects
  • Adds usage instructions to readme

@firecow firecow self-assigned this Aug 4, 2026
Comment thread oidcauth/oidcauth.go Fixed
Comment thread oidcauth/fakeidp_test.go Fixed
Comment thread oidcauth/cookie.go Fixed
@firecow
firecow force-pushed the add-oidcauth-package branch 9 times, most recently from 20e2937 to 09f67c7 Compare August 5, 2026 08:29
Authorization code flow with PKCE against an OIDC provider, with the verified id
token kept in an httpOnly cookie as the session so there is no session store to
run, and role gating read from the client_roles claim. Services that need a
browser login hand-roll this today: bearer-guard spends 450 lines on it in
package main, so none of it is importable, and mysql-admin another 300.
@firecow
firecow force-pushed the add-oidcauth-package branch from 09f67c7 to 20e683c Compare August 5, 2026 08:34
User implements slog.LogValuer so "user", user renders user.id, user.type,
user.email, user.full_name and user.roles, matching what the php package logs,
and the request path and errors go through url.path and the go-lib error helper.
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@firecow
firecow merged commit 66e9301 into main Aug 5, 2026
8 checks passed
@firecow
firecow deleted the add-oidcauth-package branch August 5, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants