OneAuth Release Notes
A token can now be bound to a key the client holds, so a leaked token is
Source: docs/RELEASE_NOTES.md
OneAuth Release Notes ¶
Versions 0.1.7 through 0.1.36 shipped tag-only; this file picks up again at
0.1.37. Usegit log v0.1.<n-1>..v0.1.<n>for anything in that range.
0.3.0 through 0.3.2 have their notes on the GitHub releases page only, and 0.3.3 and 0.3.4 shipped tag-only.
Version 0.3.21 ¶
This release adds oauth2/oidc/oidctest, a fake OpenID Provider for testing an app’s sign-in wiring. It also fixes a device-flow bug the fake found. A denied CLI sign-in through oauth2/oidc kept polling until the device code expired. The OAuch security analysis now runs in make conformance, so no conformance suite is left to run by hand.
Contract changes ¶
- New package
oauth2/oidc/oidctest(issue 566, PR 568).oidctest.New(t, oidctest.WithClient(id, secret, redirectURIs...))starts a fake issuer on anhttptest.Server.- It serves discovery, an RS256 JWKS, the code flow with S256 PKCE, the device flow (RFC 8628), RP-initiated logout and a Graph
getMemberObjectsroute. AddUsermakes a person, andSignInAspicks who the next/authorizesigns in.Approve(userCode, sub)andDenyanswer a device code.WithGroupsOverageleavesgroupsout of ID tokens the way Entra ID does.EntraGroups{GraphURL: iss.GraphURL()}resolves them through the fake.WithDiscovery,WithIDTokenClaimsandWithTokenResponseedit what the fake sends, for negative tests.- The fake redirects only to a registered URI that matches exactly. It answers
slow_downto a device poll that comes sooner than its interval, as Keycloak does.
- It serves discovery, an RS256 JWKS, the code flow with S256 PKCE, the device flow (RFC 8628), RP-initiated logout and a Graph
oidc.Newsets the token endpoint’s auth style from discovery (PR 568). Before,x/oauth2probed. It resent every failed token request in the other auth style straight away. In the device flow every pending or denied poll fails, so each poll went out twice. Keycloak answered the second copy withslow_down. A denied sign-in then polled until the code expired, and a pending one waited 5 seconds longer on every poll.- Now
oidc.Newpicks the style throughclient.SelectAuthMethodfromtoken_endpoint_auth_methods_supported, asLoginWithBrowserdoes. - Token requests now go out in one style. A provider that advertises
client_secret_basicbut only accepts the secret in the form body would now fail. Keycloak, Entra ID, Okta and Google all accept Basic.
- Now
Interop and conformance ¶
tests/keycloak/oidctest_parity_test.gosends the same code-flow and device-flow requests tooidctestand to Keycloak. It checks that both give the same error codes (PR 568).TestKeycloakOIDCSignIn_DeviceFlowDeniedcovers the denied CLI sign-in against Keycloak.tests/oauchdrives OAuch’s dashboard with playwright-go (issue 567, PR 569). It imports a site, runs the test set, handles each popup, waits out the timed tests, and checks every result againsttests/oauch/expected.yaml. A test missing from the file that doesn’t pass fails the suite.oauchmoves frommanualtoinfoinconformance/suites.yaml. The first automated run reports 133 tests, with 87 passed and 46 known.
Version 0.3.20 ¶
This release adds two helpers to the oauth2 module for apps that sign people in with GitHub or Entra ID. GitHubHostsFor maps a GitHub API root to the hosts and endpoints a sign-in needs. AllowList.Resolve fetches an Entra user’s groups from Microsoft Graph when the ID token leaves them out. ID tokens now carry a jti, and Keycloak verifies oneauth’s PS256 ID tokens in the interop suite. make release now bumps the test modules too, so make testkcl works after a release without a manual fix.
Contract changes ¶
- New
oauth2.GitHubHostsFor(api)andoauth2.GitHubHosts(issue 554, PR 561). Give it an API root for github.com, a GitHub Enterprise Server host (<host>/api/v3) or GHE.com (api.<tenant>.ghe.com). It returns the web host, the API root, the OAuth endpoint with the device flow, and the/userURL. It refuses a non-https URL unless the host is loopback, and it refuses credentials, a query or a fragment.SetEnterpriseURLuses it and sets the same URLs as before. - New
oidc.AllowList.Decide,DecisionandRule(issue 555, PR 561).Decidesays which rule let a person in: subject, email domain, hosted domain or group. It setsGroupsOveragewhen Entra leftgroupsout because the person is in too many.Allowsstill returns a bool and delegates to it. - New
oidc.AllowList.HostedDomains(issue 555, PR 561). It matches Google’shdclaim. - New
oidc.AllowList.Resolve,GroupsSourceandEntraGroups(issue 555, PR 561).Resolvecalls the source only when nothing matched, overage is set, and the list has groups.EntraGroupsposts to Graph’s/me/getMemberObjectswith the sign-in’s access token. When the source fails,Resolverefuses and returns the error. - ID tokens carry a random
jti(issue 563, PR 565). It’s 32 random bytes, hex encoded, and new on every token. A relying party that takes the ID token as an RFC 7523 assertion can now refuse a replay. Keycloak’s JWT Authorization Grant needs one unless its identity provider allows reuse.
Interop and conformance (issue 558, PR 562) ¶
- The OIDF FAPI 2.0 plan’s first client registers a PS256 key, and the second keeps ES256. The harness now runs
ensure-signed-client-assertion-with-RS256-fails, and it passes. The plan is at 46 of 52 modules passed, with 4 in review and 2 warnings, all accepted gaps. TestKeycloak_VerifiesOneauthPS256IDTokenhas Keycloak 26.6 exchange a oneauth PS256 ID token through its JWT Authorization Grant. Keycloak refuses the same claims under another key, as RS256, or a second time.
Release tooling (issue 553, PR 564) ¶
make releasemoves the oneauth requires in the unpublished modules (tests/*,docs/site) to the new version. Before,tests/keycloakfell one version behind at each release, andmake testkclstopped atupdates to go.mod needed.verify-submodule-depschecks that every unpublished module resolves withGOWORK=off.make testruns it, and CI’s lint job now does too.
CI (PR 560) ¶
- The core and sub-module tests run as a parallel matrix of OS and group.
Version 0.3.19 ¶
This release adds PS256 as an authorization-server signing algorithm, which FAPI 2.0 allows where RS256 isn’t. The client SDK and CLI now carry every client metadata field the DCR endpoint does. Relative links on the docsite stop 404ing.
Contract changes ¶
jwt.signing_alg: PS256/OneAuthConfig.SigningAlg: "PS256"(issue 330, PR 559). An RSA key signs access tokens, ID tokens, JARM responses and signed userinfo with RSASSA-PSS, and the JWKS lists the key as PS256. One key still signs under one algorithm, so an RS256 server can’t sign PS256 for a single client.utils.IsAsymmetricAlgincludes PS256 (PR 559). The JWKS handler publishes PS256 records, the registrar stores PS256 client keys, andDecodeVerifyKeyparses them as RSA. Nothing changes for a deployment that never configures PS256.fapi2acceptsjwt.signing_alg: PS256as well as ES256 (PR 559). Underfapi2,token_endpoint_auth_signing_alg_values_supportedis now[PS256, ES256].- New fields on
client.ClientRegistrationRequestandClientRegistrationResponse(issue 557, PR 559). These areJWKS(raw JSON),JWKSURI,TokenEndpointAuthSigningAlg, the logo, policy and terms URIs,SubjectType,SectorIdentifierURI,UserinfoSignedResponseAlg, the back-channel logout pair andAuthorizationDetailsTypes, plusResponseTypeson the response. - New
CIMDAppStore.UserinfoSigningAlgsandAuthorizationSigningAlgs(PR 559). A CIMD document asking for a userinfo or JARM algorithm the AS doesn’t sign with is now invalid, where before it failed at the response.NewOneAuthsets both.
PS256 (issue 330, PR 559) ¶
- ID tokens accept PS256, with
at_hashover SHA-256. - A client key stored as PS256 authenticates with
private_key_jwt. - oneauth-server’s
code_flow.oidc,code_flow.jarmand key rotation accept PS256, and the ephemeral PS256 key is RSA-2048. make exercise-jarmregisters its client with the algorithm the server advertises, so it passes against an ES256 server and against a PS256 one.
Client metadata parity (issue 557, PR 559) ¶
- A drift test compares the SDK’s DCR structs with the server’s, so the next server field can’t lag.
oneauth dcr registerandputtake--metadata FILE, which sets any RFC 7591 field from JSON, with explicit flags winning. A field the CLI doesn’t know is an error, so a misspelling isn’t dropped silently.- CIMD documents carry
dpop_bound_access_tokens,require_pushed_authorization_requestsanduserinfo_signed_response_alg, and the AS enforces them as it does for a registered client. - DCR keeps ignoring metadata it doesn’t understand, as RFC 7591 §2 requires, and a test now pins it. The response echoes what was stored.
Docsite (PR 559) ¶
- Relative links in rendered markdown now point at the page that renders the target, or at the file on GitHub. A build had 501 broken
.mdlinks across 52 pages, and now has none. - LANDSCAPE.md’s per-RFC template renders as one code block again.
CI and tests ¶
- CI now runs the
cmd/oneauthanddocs/sitetests. Before, the CLI tests never ran there. tests/keycloak/go.modfollows the root version again (issue 553, which keeps recurring with each release).- Not done: an OIDF FAPI 2.0 run with a PS256 client, and Keycloak verifying oneauth’s PS256 tokens (issue 558).
Version 0.3.18 ¶
This release finishes JWT Secured Authorization Response Mode (JARM). A FAPI client can ask for response_mode=jwt and get its authorization response back as one JWT that the AS signs. The client SDK verifies it before it uses the code. make exercise-jarm logs in this way against oneauth-server and against Keycloak, and refuses a response with a tampered signature.
Contract changes ¶
- New optional
OneAuthConfig.JARM(PR 551). Nil, the default, keeps today’s behavior, and the JARM modes stay refused withinvalid_request. Set, it needs an RS256 or ES256 key, andNewOneAuthpanics on an HMAC secret or an empty issuer. AuthorizationResponsegainsSignedandParams()(PR 551). For a JARM response,Modeis the base delivery mode (query.jwtisResponseModeQuery), andParams()returns the oneresponseparameter.RedirectURLsigns too, and it returns an error when signing fails.- A JARM response carries RFC 9207
issinside the JWT, not on the URL (PR 551). A client checkingisson a JARM redirect has to read it from the verified JWT. LoginWithBrowserwith a JARMResponseModenow verifies the response (PR 552). In v0.3.17 it refused every callback. It now takescodeandstatefrom aresponseJWT that passesclient.VerifyAuthorizationResponse. A plaincodeunder a JARM mode still fails withErrUnverifiedAuthorizationResponse.LoginWithBrowserrefusesfragmentandfragment.jwtbefore it opens the browser (PR 552). A fragment never reaches the loopback server, so these used to time out.- New
core.AppRegistration.AuthorizationSignedResponseAlg(PR 556). The gorm store adds a column on the nextAutoMigrate. The gae entity and the fs store need nothing. - DCR now refuses
authorization_signed_response_algit can’t serve (PR 556). On an AS without JARM that means every value. Before, DCR dropped the field silently and answered 201.
Signed authorization responses at the AS (issue 411, PR 551) ¶
/authorizeacceptsjwt,query.jwt,fragment.jwtandform_post.jwt, through PAR too.jwtmeansquery.jwtforcodeandfragment.jwtfor the implicit types.query.jwtis refused for the implicit types, likequery.- The JWT carries
iss,aud(the client_id), a 60-secondexp(JARMConfig.Expiry),state, and the code or error. It’s signed with the AS key, with thekidthe JWKS publishes. - Errors that go to the redirect_uri are signed too. A response the AS can’t sign shows a
server_errorpage, and never goes out unsigned. - AS metadata lists the JARM modes in
response_modes_supported, and addsauthorization_signing_alg_values_supported(ASServerMetadata.AuthorizationSigningAlgValuesSupported,OneAuth.AuthorizationSigningAlgs). - oneauth-server turns it on with
code_flow.jarm.enabled, and refuses to start with it under an HMAC key or without the code flow.
Verifying them in the client SDK (issue 412, PR 552) ¶
client.VerifyAuthorizationResponsechecks a JARM response: an asymmetric signature by a key in the AS’s JWKS,issequal to the discovered issuer,audcontaining the client, and an unexpiredexp. Failures wrapErrUnverifiedAuthorizationResponse.- An
errorinside a verified response comes back as a*CallbackError, like a denial on a plain response. - The loopback callback reads a POSTed form, so
form_post.jwtworks. - Keycloak 26’s JARM JWT repeats
iss. The last value wins, asencoding/jsondoes, so its responses verify. oneauth token browser --response-mode jwtverifies the response the same way.
Registering the signing algorithm (issue 413, PR 556) ¶
- A client registers
authorization_signed_response_algthrough DCR (JARM §3). DCR accepts onlyAppRegistrar.AuthorizationSigningAlgs, sononeis refused. Every app store keeps the field, CIMD documents carry it, and register, read and RFC 7592 update echo it. - The AS signs with the client’s registered algorithm. One it can’t sign with fails the response with
server_error. - Registering an algorithm doesn’t turn JARM on. The client still asks with
response_mode=jwt, as Keycloak does. With none registered, the AS uses its own key’s algorithm, not the RS256 JARM §3 names. client.ClientRegistrationRequestandClientRegistrationResponseget the field, andoneauth dcr registerandputget--authorization-signed-response-alg.- Not done: PS256 with an RSA key, since the JWKS lists the key under RS256 only (issue 557), and encrypted responses.
Testing and conformance ¶
make exercise-jarmpasses on both targets, and a third run flips one character of the response signature and must be refused. It runs as the gatingjarmsuite inmake conformance.TestKeycloak_JARMLoginlogs in withjwt,query.jwtandform_post.jwtagainst Keycloak’s PS256 responses.testutil.KeycloakPasswordLoginsubmits a form_post response page, as a browser’s script would.tests/keycloak/go.modfollows the root version again, after the v0.3.17 and v0.3.18 releases left it behind (issue 553).
Docs and CI ¶
- A JARM page on the docsite (
specs/jarm), linked from the specs index and the nav. The FAPI and landscape pages no longer list JARM as a gap, and the client SDK guide coversResponseMode. - The browser auth guide documents
oidc.Provider.LogoutURLfrom v0.3.17. - The vulncheck workflow moves to
panyam/ci-actionsv0.1.4, which titles the issue it files by what stopped the scan.
Version 0.3.17 ¶
This release lets an app list every API key and sweep the expired ones through the store interface. It also adds OIDC RP-initiated logout, stops the GitHub and Google callbacks from echoing the state cookie, and adds the JARM mission’s exercise.
Contract changes ¶
- New optional
core.APIKeyAdmin(issue 549, PR 550). It hasListAPIKeysandCleanupExpiredAPIKeys.APIKeyStoredoesn’t change, so a custom store still compiles. Callers check for the new interface with a type assertion. - The gorm
APIKeyModelgets an index onexpires_at(PR 550). The nextAutoMigratecreates it. client.ASMetadatagainsEndSessionEndpoint(PR 547).- A browser login with a JARM response mode now refuses every callback (PR 548).
LoginWithBrowserreturnsErrUnverifiedAuthorizationResponseuntil the SDK can verify signed responses (issue 412).
Listing and sweeping API keys (issue 549, PR 550) ¶
ListAPIKeysreturns every key in the store, across subjects, withKeyHashempty.CleanupExpiredAPIKeysdeletes every key whoseExpiresAtis at or beforereq.Now, revoked or not. It never deletes a key with noExpiresAt. A zeroNowmeans the current time, andRemovedreports the count.- The fs, gorm and gae stores implement it. On fs, a listing skips a key file that another handle deletes mid-scan, where reading the directory directly used to fail.
apikeytest.RunAdminis the shared contract suite for a custom store.
OAuth sign-in (issue 546, PR 547) ¶
- The GitHub and Google callbacks check state through
oauth2.VerifyState. Every state failure answers 400invalid oauth state. The old error page printed the realoauthstatecookie value. oidc.Provider.LogoutURL(idTokenHint, postLogoutRedirectURI, state)builds the RP-initiated logout redirect from the issuer’send_session_endpoint, so a sign-out at the app can also end the issuer’s session.
JARM mission exercise (issue 410, PR 548) ¶
oneauth token browsertakes--response-mode.make exercise-jarmlogs in headless withresponse_mode=jwtagainst oneauth-server and the test Keycloak realm. It prints each callback and the CLI’s result. Both targets still fail at the step that issues 411 and 412 fix.
Version 0.3.16 ¶
This release adds a sign-in provider for any OpenID Connect identity provider, beside GitHub and Google. It also lets an authorization server behind a TLS-terminating proxy check DPoP proofs and client assertions without pinning its URLs.
Contract changes ¶
oauth2now requires the root module (PR 545). The newoauth2/oidcpackage importsclientandkeysfor discovery and ID token checks, sogo.sumfor anoauth2user lists jwt, fernet and otel. The baseoauth2package still imports nothing from oneauth, so an app using only GitHub or Google compiles none of it.- New optional
TrustedProxiesfields (PR 544). These areOneAuthConfig.TrustedProxies,DPoPConfig.TrustedProxies, and the field of that name onIntrospectionHandler,RevocationHandlerandPARHandler.NewTokenEndpointHandlercopiesOneAuth.TrustedProxiesinto the handler’s existing field, which also gatesX-Forwarded-Forfor rate limiting. Empty keeps today’s behavior. oauth2exportsRedirectWithPKCEandVerifyState(PR 545). A provider in another package uses them to set and check the same state, PKCE and callback cookies.
Generic OpenID Connect sign-in (issue 542, PR 545) ¶
oidc.New(ctx, oidc.Config{Issuer, ClientID, ClientSecret, CallbackURL, HandleUser})signs people in through Entra ID, Okta, Google Workspace, Keycloak, or any other provider, by issuer URL. It mounts like the GitHub provider.- Discovery runs once in
New. The JWKS is fetched on first use and again when a token names an unknownkid, so a key rotation needs no restart. The issuer must be https, or http on a loopback host. - The browser flow sends PKCE and a
nonce.HandleUserruns only afterclient.VerifyIDTokenchecks the ID token’s signature,iss,aud,exp,nonceandat_hash, and it receives the token’s claims. DeviceAuthandDeviceAccessTokensign in from a CLI when discovery lists a device endpoint. They send the client secret at the device endpoint, whichx/oauth2leaves out and Keycloak requires for a confidential client.oidc.AllowListdecides who may sign in, by verified email domain, agroupsvalue orsub. An empty list allows nobody.oauth2/oidc/exampleruns both flows against the Keycloak indocker-compose.yml.
Proxied deployments (issue 541, PR 544) ¶
core.TrustedProxies.IsHTTPS(r)reports whether the client used https. It is true whenr.TLSis set. It is also true when the TCP peer is a trusted proxy and that proxy’s firstX-Forwarded-Protovalue says https, or else the firstForwardedelement’sprotodoes. From any other peer the headers are ignored.- With no pinned
EndpointURLorBaseURL, a DPoP validator derives the expectedhtufrom the request. Behind a trusted proxy that says https, thehtuis now https, matching the URI the client called (RFC 9449 §4.3). - With no
AcceptedAudiences, the token, PAR, introspection and revocation endpoints derive the client-assertion audience the same way.X-Forwarded-Hostis still never read.
Tests ¶
- The Keycloak test realm gains
emailandprofileclient scopes and the device grant ontest-confidential. Runmake downkclbeforemake testkclso a running container picks up the new realm. - Keycloak interop CI now also runs on changes under
oauth2/.
Version 0.3.15 ¶
This release moves oneauth onto new releases of its panyam dependencies. It also carries release tooling fixes made after v0.3.14. The library API is unchanged.
Fixed ¶
- The vulncheck workflow now scans release tags with
GOFLAGS=-mod=mod. A release commit can’t hold its owngo.sumhashes, so the scan failed on tags before this fix (issue 537, PR 538). - The sub-modules’
go.sumfiles now record the v0.3.14 module hashes. This coverscmd/*,grpc,sshkeys,stores/gaeandstores/gorm.
Changed ¶
- The mcpauth TypeScript fixture now uses pnpm instead of npm, at the same resolved versions. It pins pnpm 12.11.2, and
scripts/exercise-mcpauth.shinstalls and runs it with pnpm (PR 539). - The conformance report now covers a full
make conformancerun on main at v0.3.14. Every suite passes.
Dependencies ¶
github.com/panyam/demokitanddemokit/notebookmove from v0.0.25 to v0.0.33.github.com/panyam/gocurrentmoves from v0.1.1 to v0.1.3 in the root module andtests/mcpauth.github.com/panyam/goutilsmoves from v0.1.13 to v0.1.16 indocs/siteandtests/mcpauth.github.com/panyam/servicekitmoves from v0.2.2 to its latest release intests/mcpauth.- The docs site moves to s3gen v0.1.6 and drops its templar v0.0.20 pin (PR 540).
Version 0.3.14 ¶
This release lets a client use an https URL it controls as its client_id, through Client ID Metadata Documents (CIMD). The MCP authorization spec asks authorization servers to support them. It also adds the MCP conformance framework’s authorization-server scenarios to make conformance. Every expected outcome in known-gaps.yaml is now marked as an open gap or an accepted one.
Contract changes ¶
- The token endpoint answers a failed client lookup with an OAuth error instead of 500 (PR 536). The confidential-client check, the
dpop_bound_access_tokenslookup and the registered-scope lookup each turned any lookup error other than “not found” intoserver_error. A bad client metadata document now getsinvalid_client, and an unreachable one gets 503temporarily_unavailable. Other store errors are still 500. - Device authorization passes a lookup error’s own status through (PR 536). Only the CIMD errors carry one, so registered clients see no change.
- New optional fields (PR 536). These are
OneAuthConfig.ClientIDMetadataDocuments,ASServerMetadata.ClientIDMetadataDocumentSupported, andAppRegistration.JWKS.AppRegistration.JWKSholds a CIMD client’s inline keys in memory only, and stores never save it. - The toolchain is Go 1.27.4 (PR 534). The
golines stay at 1.26.9, so importers keep the same minimum Go.
Client ID Metadata Documents (issue 532, PR 536) ¶
OneAuthConfig.ClientIDMetadataDocuments, orcode_flow.client_id_metadata_documentson the reference server, turns it on. It’s off by default, and FAPI 2.0 refuses it.apiauth.CIMDAppStorewraps the app store. Aclient_idthat starts withhttps://is fetched, checked against draft -03, and cached. So/authorize, the token endpoint, userinfo and the consent page all accept it.- The fetch follows no redirect, accepts only a 200, reads at most 5 KB, and dials no private address unless
allow_private_client_hostsis set. It caches for the response’smax-age, clamped to between 1 minute and 24 hours. - Clients can use
nonewith PKCE, orprivate_key_jwtwith keys in the document’sjwksor at itsjwks_uri. A document with a secret or a shared-secret method is refused. - The consent page names the host that publishes the document and the host the user returns to. A URL client’s
logo_uriisn’t shown. - Discovery advertises
client_id_metadata_document_supported. The new docsite pagespecs/cimd/explains it.
Conformance ¶
mcp-auth-asis a new gating suite. It runs the MCP framework’s authorization-server scenarios against oneauth-server, and a headless login approves each authorization request (PR 533, issue 496). It runs once with a registered client and once with a CIMD client, and all 12 checks pass (PR 536).- Each
known-gaps.yamlentry now has aclass. Anopenentry is a gap with an open issue, and anacceptedentry is an outcome oneauth keeps on purpose. The report’s new Known gaps section lists all 24, andmake gapcheckfails when an open entry cites a closed issue (PR 535). make up-all,down-all,ps-allandlogs-allstart and stop every Docker service the tests use, from a top-leveldocker-compose.yml(PRs 530 and 531, issue 243).- A weekly workflow runs
make vulncheckover every published module (PR 534).
Version 0.3.13 ¶
This release fixes a regression in 0.3.12. An AS with no AllowedResources refused every authorization-code redemption that named a resource, so MCP clients such as mcpkit’s OAuth token source couldn’t get a token.
Fixed ¶
- The code grant falls back to the allowlist when the code carries no resources (PR 529). Without an allowlist,
/authorizeignoresresourceand stores none on the code. The token request then narrowed against that empty list and gotinvalid_target. Now a code with no stored resources checks the token request’sresourceagainstAllowedResources, as the device grant and refresh already did. With no allowlist the AS ignores it, andaudkeeps its default. A code with stored resources still narrows as before.
Version 0.3.12 ¶
This release binds access tokens to the RFC 8707 resource a client names, on every grant. It closes the code findings from the OAuch run, adds response_mode=form_post, and lets a user withdraw consent from a connected-apps page. The FS refresh-token store stops keeping tokens in plaintext. Three OIDF plans (Form Post Basic, Implicit and Form Post Implicit) and a third MCP server-auth suite join make conformance.
Contract changes ¶
- Client credentials in the request URI get a 400 (PR 525). A
client_secret,client_assertionorclient_assertion_typein the query string of the token, PAR, introspection, revocation or device endpoint isinvalid_request. Those endpoints read every other parameter from the body only. - A repeated parameter gets
invalid_request(PR 525). It used to take the first value.resourceandaudiencemay still repeat. At/authorize, a repeatedclient_idorredirect_urishows the error page. - Code redirects end in
#_=_(PR 525), as RFC 9700 section 4.1.3 suggests. - An unknown
response_modegetsinvalid_request(PR 527). So doesqueryfor an implicit response type. MountProtectedResourcewith a path serves its metadata only at the path URL (PR 524). A resource with no path still gets the root URL. RFC 9728 section 3.3 makes a client discard the root copy of a pathed resource’s document.- New stored fields (PR 527).
DeviceAuthorization.Resourcesholds the device flow’s resources, and GAE consent grants gain an indexedsubject. GAE grants saved earlier get it on their next read, or all at once fromGAEConsentStore.BackfillConsentSubjects(PR 528). - GORM
RevokeAPIKeyreturnsErrAPIKeyNotFoundfor a missing key (PR 528), as FS and GAE already did. error_descriptiontext is mapped into RFC 6749’s character set (PR 528). “§” becomes “section”, double quotes become single quotes, and other characters outside printable ASCII become?. Error codes are unchanged.- The FS refresh-token store keeps only hashes (PR 528). Files are named by
TokenHash, and new records have an emptytoken. Older files still load and lose their plaintext on the next rotation or revocation.
Resource indicators (issues 521 and 523) ¶
OneAuthConfig.AllowedResources, orjwt.resourceson the reference server, lists the resource servers the AS issues tokens for (PR 524). A named resource becomes the access token’saud, and an unlisted one isinvalid_target. With no list the AS ignoresresource, as before.- Client credentials, the code grant, refresh and implicit honor it (PR 524), and so do the device and password grants (PR 527). A code, device code or refresh token keeps its resources, and a later token request may narrow them but not widen them.
trusted_assertion_issuerson the reference server turns on the jwt-bearer and token-exchange grants, with a PEM key or JWKS URI per upstream IdP (PR 524).
Authorization endpoint and consent ¶
response_mode=form_postanswers with an auto-submitting form, for successes and errors, through consent and PAR (PR 527, issue 500). Discovery listsresponse_modes_supported. The page escapes every value and allows only its own script, by nonce.- Users can withdraw consent at
/auth/connected-appson the reference server (PR 527, issue 516). Revoking ends the client’s refresh-token families, blacklists their access tokens, firesOnTokenRevoked, and then deletes the grant. Library users get the same logic fromapiauth.ClientAccessRevokerand the new optionalcore.ConsentLister. A code issued before the revoke still works for up to 60 seconds, and an unrecorded access token, such as an implicit one, for up to 15 minutes (PR 528). - Implicit
id_token tokenaccess tokens carry the OIDCclaimsrequest, so userinfo honors it (PR 528).
Conformance ¶
- An OAuch rerun after PR 525 passes the four findings from issue 519. The finished run, with the timed tests, mitigates 33 of 40 threats (
docs/conformance/oauch.md). - New gating suites:
mcp-auth-tsruns the MCP scenarios through the official TypeScript SDK (PR 524), andoidf-formpost-basic(PR 527),oidf-implicitandoidf-formpost-implicit(PR 528) run three more OIDF plans. - The Makefile’s Docker volume paths use
$(CURDIR), somake conformancemounts the real Keycloak realm (PR 528).
Version 0.3.11 ¶
This release finishes what the OIDF Dynamic OP plan asked of oneauth: pairwise subjects, runtime signing-key rotation, and an opt-in implicit flow. It also makes logout cut off access tokens, issues ID tokens on the refresh grant, and fixes two security headers that stopped real browsers finishing an authorization with the reference server. The OIDF plans now run nightly in CI, and two MCP server-auth suites join make conformance.
Contract changes ¶
- Custom refresh-token stores should fill
RevokeSubjectTokensResponse(PR 517). It now carries the unexpired access tokens of every revoked family, asRevokeTokenFamilyResponsealready did. Logout-all and password reset blacklist them. A store that returns the empty struct still compiles, but its access tokens keep working until they expire. - New stored client and token fields (PRs 513, 515, 517). Apps gain
subject_type,sector_identifier_uri,response_typesanduserinfo_signed_response_alg, and refresh tokens gain the login’s OIDC context (RefreshToken.OIDC). GORM adds the columns throughAutoMigrate, and GAE adds unindexed properties. Old rows read them as empty. - DCR echoes
response_types,["code"]by default (PR 515). A client that sendsresponse_types: ["code"]with grant types lackingauthorization_codeis now refused, as RFC 7591 section 2.1 pairs them. - Reference server headers (PR 520). The CSP no longer has
form-action, and/authorizeand/auth/pages sendCross-Origin-Opener-Policy: unsafe-none. Every other page still sendssame-origin.
OIDC Dynamic OP features (issue 507) ¶
- Pairwise subjects (PR 513). DCR accepts
subject_type: pairwiseandsector_identifier_uri. ID tokens, userinfo and back-channel logout tokens carry a per-sectorsubfromOneAuth.SubjectForClient. Access tokens and introspection keep the user’s own ID. - Signing-key rotation (PR 514).
RotatingSigningKeyandSigningKeySourcelet the AS change its signing key while running, and the reference server exposesPOST /admin/signing-key/rotate. The JWKS publishes retired keys for their grace period throughJWKSHandler.RetiredKeysandKidLister(issue 421). - Implicit flow, off by default (PR 515).
OneAuthConfig.AllowImplicit, orcode_flow.impliciton the reference server, servesid_tokenandid_token tokento clients registered for them. Tokens come back in the fragment withat_hashand a requirednonce. FAPI 2.0 refuses it. - In the OIDF Dynamic OP plan these took the code run from 5 passed to 12 passed. Both implicit response types run as plans of their own.
Tokens and OIDC (issues 451 and 485, PR 517) ¶
- Logout, logout-all and password reset (
NewRevokeSessionsOnResetWithBlacklist) blacklist the sessions’ access tokens. - The refresh grant issues an ID token for an
openidgrant, repeating the login’sauth_time,acr,amrand claims request. The SDK’s automatic refresh keeps and verifies it. - Signed userinfo for clients registered with
userinfo_signed_response_alg, through the newUserinfoSigner. acr_valuesat/authorize, anAuthContextFromRequesthook, andacr/amrin ID tokens.oneauth token browser --verify-id-tokenchecks the ID token it receives.
Reference server ¶
- In Chrome, consent and login couldn’t redirect back to the client, because CSP
form-action 'self'covers that redirect. Popup logins also lost their opener under COOPsame-origin. Both are fixed (PR 520). The OIDF harness’s browser enforces neither header. jwt.audiencestamps anaudon issued tokens (PR 522).
Conformance ¶
- The OIDF workflow runs every plan nightly and on demand against the harness pinned at
release-v5.3.3(PR 520, issue 498). - One audited OAuch run is recorded as a new
manualsuite kind: 107 tests, 13 failed, each triaged indocs/conformance/oauch.md(PR 520, issue 497). Its gaps are issue 519. - Two gating MCP server-auth suites,
mcp-auth-gosdkandmcp-auth-mcpkit, run oneauth-server behind the official Go SDK and mcpkit (PR 522, issue 495).
Version 0.3.10 ¶
This release fixes the GitHub and Google sign-in providers in the oauth2 module, which agni needs for Sign in with GitHub. It also lets a private_key_jwt client register a jwks_uri and puts the client’s logo, policy and terms on the consent page. Two changes alter what a consumer sees, and both are listed under contract changes.
Contract changes ¶
- A userinfo answer other than 200 fails the sign-in (PR 512). GitHub answers a bad token with 401 and a JSON body, and that body used to reach
HandleUseras the person’s profile. The Google and GitHub callbacks now redirect toAuthFailureUrlinstead. A fake provider in tests that answers 201 or similar will now fail. - Five new
app_registrationscolumns (PR 509). GORM adds them throughAutoMigrate, and GAE adds five unindexed properties. Old rows read them as empty.
Sign-in providers (issues 510 and 511, PR 512) ¶
GithubOAuth2logged the person’s access token, and the refresh token, on every sign-in. It no longer logs any token.GoogleOAuth2sends the access token to userinfo as a Bearer header. It used to put it in the URL, and a failed request logged the URL inside the error.(*GithubOAuth2).SetEnterpriseURLpoints the provider at a GitHub Enterprise Server or GHE.com host. It sets the authorize, token, device and userinfo URLs, and it allows plain http only for a loopback host, so tests can use a fake server.BaseOAuth2.OAuthEndpointreturns the endpoint in use.SetOAuthEndpoint,UserInfoURLandSetHTTPClientalready let a test run the whole sign-in against a fake provider, and their docs now say so.
Client metadata in DCR (issue 507, PR 509) ¶
- DCR accepts
jwks_uriforprivate_key_jwtclients. oneauth fetches the key set when the client authenticates, picks the key bykid, and refetches once on an unknownkid, so a client rotates its key by publishing a new one. - The fetch is https only. It refuses private and loopback addresses, follows no redirect, reads at most 64 KiB, and refetches at most every 30 seconds. The reference server’s
admin_auth.allow_private_client_hostsandclient_fetch_ca_filerelax this for test setups. token_endpoint_auth_signing_algpins ajwks_uriclient’s assertion algorithm, so PS256 and EdDSA clients work this way.- DCR stores
logo_uri,policy_uriandtos_uri(https only). The consent page shows the logo and links to the policy and terms, and adds only the logo’s origin to its CSPimg-src. - In the OIDF Dynamic OP plan,
registration-jwks-uriandrefresh-token-rp-key-rotationnow pass.
Version 0.3.9 ¶
The whole repo’s tests now run on Windows. That run found two bugs in the FS stores, and this release fixes both. It also adds make conformance, which runs every conformance suite from one command and publishes a report. One change alters what a consumer sees, and it’s listed under contract changes.
Contract changes ¶
- FS stores refuse a key whose file holds another key (issue 505, PR 506). The FS stores turn
/,\and:in a key into_to build a file name. So user IDa/bused to read, overwrite or delete the record fora_b. On Windows and on a default macOS volume,Alicedid the same toalice. The user, username, app, key, kid and API key stores now check the key inside the file before they read, write or delete it, and returnfs.ErrKeyCollisionwhen it differs. The identity and channel stores already did this (issue 88).
FS stores on Windows (issues 502 and 505, PRs 503 and 506) ¶
- The identity store put
:in file names, which Windows refuses, so every identity write failed. File names on Windows now map<>:"|?*and control characters to_. - A file name that is a Windows device name (
CON,NUL,COM1and the rest) gets a_in front. Windows 10 and Server 2022 openCON.jsonas the console. safeNamerefused/etc/passwdon Unix but not on Windows, becausefilepath.IsAbsthere wants a drive letter. It now refuses any key that starts with/or\on every OS.- CI runs every module’s tests on Windows.
make conformance (issues 490, 491, 492, PR 504) ¶
make conformanceruns every suite listed inconformance/suites.yamland prints one line per suite.SUITE=<name>runs one suite.- Each run merges into
docs/conformance/report.jsonandREPORT.md. The docsite shows it on a “Latest run” page, and the README links it. - A suite whose tests all skip reports SKIP with the reason, not PASS.
- Every wait for a server or container has a time limit and prints the process’s log if it dies.
docs/CONFORMANCE.mdhas a table that says which of the OIDF suite’s 81 plans apply to oneauth.
Version 0.3.8 ¶
Most of this release moves /authorize, the ID token and userinfo closer to OIDC Core, driven by the OIDF Basic OP plan that make exercise-oidcc now runs. It also fixes file: secret refs on Windows, which agni needs. Two changes alter what a consumer sees, and both are listed under contract changes.
Contract changes ¶
- The ID token no longer carries scope claims (issue 480, PR 488). A request for
scope=openid emailused to putemailin the ID token as well as userinfo. OIDC Core §5.4 sends those claims to userinfo, so the ID token now carries only claims the request asks for by name with theclaimsparameter. The client SDK’sLoginWithBrowserwithVerifyIDTokenasks for the four claimsIDTokenClaimsreads, so SDK users keep them. Other clients that read profile claims from the ID token should call userinfo or sendclaims. - An
APIMiddlewarewithoutDPoPrefuses DPoP-bound tokens (issue 486, PR 488). A token withcnf.jktsent as Bearer used to pass, so a stolen bound token worked at any resource server that hadn’t wired DPoP. It now gets 401invalid_token.
OIDC at /authorize (PRs 483, 484) ¶
POST /authorizewithout anactionfield gets a 303 toGET /authorizewith the same parameters, as OIDC Core §3.1.2.1 requires. The consent form always postsaction, so its decisions still go through CSRF.- A
requestparameter getsrequest_not_supported, and arequest_urithat oneauth’s own/pardidn’t issue getsrequest_uri_not_supported. Before,/authorizeignored both and used the outer parameters. prompt=login, and a login older thanmax_age, send the user through the login page once.prompt=nonenever shows a page and answerslogin_requiredorconsent_requiredat the redirect URI.core.ConsentStoreremembers consent, with memory, FS, GORM and GAE backends. SetAuthorizeMountConfig.ConsentStore, orcode_flow.consent.rememberon the reference server, and a request covered by earlier consent skips the consent screen unless it sendsprompt=consent.
Claims and userinfo (PRs 487, 488) ¶
/authorizeaccepts the OIDCclaimsparameter (§5.5). The ID token and userinfo add the claims it names, and discovery advertisesclaims_parameter_supported.- Userinfo accepts the access token as a form-encoded
access_tokenon POST (RFC 6750 §2.2). Sending it in the header as well is 400invalid_request. - Signup accepts the standard profile claims a deployment lists (
SignupPolicy.ProfileClaims, orsignup.profile_claims), andlocalauth.ProfileClaimshands them out by scope. The server listsaddressandphoneinscopes_supported. - Userinfo returns
updated_atunderprofilethrough the optionalaccounts.LastUpdatedUserinterface. The FS, GORM and GAE user types implement it.
PKCE policy for confidential clients (PR 482) ¶
OneAuthConfig.PKCEPolicy = PKCEOptionalForConfidential(code_flow.pkce: optional_for_confidential) lets registered confidential clients omit PKCE, as OIDC Core allows. The default still requires PKCE from every client.
Windows file secret refs (issue 499, PR 501) ¶
outbound.ParseSecretRefaccepts any pathfilepath.IsAbsaccepts, sofile:C:\secrets\app.pemworks on Windows. A path starting with/still works on every OS. CI runs theoutboundtests on Windows.
Conformance and release tooling (PRs 475, 476, 482) ¶
make exercise-oidccruns the OIDF Basic OP plan against the reference server and judges each module againstknown-gaps.yaml.make testoidfruns it after FAPI 2.0.make pushreleaserecords the new version’sgo.sumhashes before pushing main, so v0.3.7’smissing go.sum entrydoesn’t recur.verify-submodule-depsfails when they’re missing.- The reference server’s tests run the device flow end to end on FS, Postgres and GAE stores.
Version 0.3.7 ¶
This is the first release cut with make release. Every module is tagged v0.3.7 on one commit and requires every other oneauth module at v0.3.7, and the commands are go install-able. The release also adds FS and GAE stores for authorization codes and pushed requests, and hashes every single-use credential at rest.
Release process (PR 472) ¶
make release V=vX.Y.Zwrites one commit that sets everygithub.com/panyam/oneauth*require to the new version, then tags the root and all ten sub-modules on it.make pushreleaseandmake verify-installfollow.bump-rootis gone.- Published
go.modfiles no longer carryreplacedirectives, sogo install github.com/panyam/oneauth/cmd/oneauth-server@v0.3.7works. Local development usesgo.work. cmd/oneauth-serverandcmd/demo-resource-serverhad requiredstores/gormandstores/gaeat v0.1.33. They now track the release.
FS and GAE stores for the code flow and PAR (issue 382, PR 472) ¶
stores/fs.FSAuthorizationCodeStore,stores/fs.FSPushedAuthorizationRequestStore,stores/gae.GAEAuthorizationCodeStoreandstores/gae.GAEPushedAuthorizationRequestStore. A deployment on FS or Datastore no longer needs SQL for the code flow.- The reference server accepts
code_flow.store.type: fsandgae, and PAR uses the same backend.
Single-use credentials hashed at rest (PRs 472, 474) ¶
- Authorization codes, pushed
request_uris and RFC 8628 device codes are stored undercore.AtRestKey, a SHA-256 digest, in the FS, GORM and GAE stores. A copy of a store can’t redeem a code or poll for a device’s tokens. Records written by earlier versions keep working. - Contract change: device lookups by user code (
GetByUserCode, andApproveDeviceAuthorization’s response) returnDeviceCodeempty, since no store can recover it.
Fixes ¶
- GORM device approval can’t override a denial (PR 474). Approve read the row and then saved it, so a racing denial could be overwritten and both callers told they succeeded. That happened in half of 300 races on Postgres. It’s now an update conditional on the status still being pending.
- The shared store race tests (
authcodetest,partest,deviceauthtest,usertokentest) now make their calls overlap. They release the goroutines together after a warm-up read. Without that, they passed while the GORM bug was there.
Version 0.3.6 ¶
This release gives outbound user tokens stores that replicas can share, and a way to revoke a token when a person disconnects. It also adds a live smoke test against real GitHub, which corrected our fake GitHub in three places. The sub-modules now require root v0.3.5, so stores/gorm and stores/gae can use outbound.
User-token stores for replicas (issue 468, PR 470) ¶
stores/gorm.UserTokenStoredoes compare-and-swap in one SQL statement: an insert withON CONFLICT DO NOTHING, or an updateWHERE version = ?. Its table isoutbound_user_tokens, added toAutoMigrate.stores/gae.GAEUserTokenStoredoes the read, compare and write in one Datastore transaction, under kindOutboundUserToken.- Both pass
usertokentest.RunAllon Postgres and on the Datastore emulator.
Revoke on disconnect (PR 470) ¶
UserTokens.Revokerevokes a person’s token at the provider through aTokenRevoker, then deletes the record. Any failure keeps the record, so it can be retried.outbound.GitHubRevokercallsDELETE /applications/{client_id}/token, or/grantwithRevokeGrantto remove the whole authorization. Only a 204 counts, since GitHub answers 404 both for an already-revoked token and for wrong client credentials.- Behaviour change: a refresh that loses a race with
DeleteorRevokenow answersErrUserTokenNotFound. Before, it handed out the token it had just refreshed.
Live GitHub smoke test (PR 471) ¶
make testghrunsoutboundagainst github.com. It never runs inmake testor CI. It covers a PAT, App installation tokens, a token narrowed to one repo, caching, refusals, and an opt-in device-flow refresh-and-revoke. Setup is indocs/OUTBOUND_CREDENTIALS.mdand needs no callback URL.outbound/githubtestnow matches real GitHub for an unknown App ID (404 “Integration not found”), for refresh (the previous access token stops working) and for revoking twice (404). Consumers’ tests that reused an access token after a refresh will now see it refused, as GitHub would.
Fixes ¶
- GAE refresh-token store kept every concurrent access token (PR 471).
RecordAccessTokenand the per-member transaction inRevokeTokenFamilynow allow 10 attempts rather than Datastore’s default 3. Before, about one run in 70 of five concurrent records lost one, and family revocation then missed it. - The GORM Postgres test helper closes the connection it uses to create a schema (PR 470). It used to leak one per test until
make testpghit Postgres’s client limit.
Version 0.3.5 ¶
This release adds outbound/, for an app calling someone else’s API as itself or for one of its users. goapplib’s storage mounts over private GitHub repos are the first consumer. The sub-modules still require the root at v0.3.4. The next release bumps them, together with the GORM and GAE user-token stores (issue 468).
Outbound credentials (issue 467, PR 469) ¶
outbound.GitHubAppInstallationsigns a GitHub App’s JWT (RS256, nine-minute life), trades it for an installation token, and caches it until five minutes before expiry. Concurrent callers share one fetch. It reads GitHub’s PKCS#1 App keys, andBaseURLpoints it at GitHub Enterprise.outbound.UserTokens/StoredUserTokenkeep a person’s token sealed in aUserTokenStore, and refresh it with a compare-and-swap write. GitHub’s refresh tokens are single-use, so a replica that loses a refresh race waits for the winner’s token instead of overwriting it with a dead one. The errors to act on areErrUserTokenNotFoundandErrReconnect.outbound.Staticreads a personal access token from aSecretRef(env:NAMEorfile:/abs/path) on every call. A bare value is refused.outbound.MemoryUserTokenStore,stores/fs.FSUserTokenStoreand theusertokentest.RunAllcontract suite. Both stores do compare-and-swap within one process only.outbound/githubtestis a fake GitHub for tests. It checks App JWTs, issues installation tokens and single-use refresh tokens, and serves/userand/installation/repositoriesfor live tokens.- Design and threat notes:
docs/OUTBOUND_CREDENTIALS.md, published under Design.
Keys ¶
keys.Sealeris the AES-256-GCMoaenc1:format, moved out ofEncryptedKeyStorageso other stores can use it. It takes an HKDF purpose label and per-record AAD. The key stores keepKeyStorePurpose, so existing records open unchanged.
GitHub and Google providers (oauth2 sub-module) ¶
SetScopes/Scopesreplace the default login scopes.AllowedExtraScopeslets a login link add scopes with?scope=, for examplerepoon a later connect.- Behaviour change: a
?scope=value that isn’t on the list now gets 400, where before it was ignored. This applies to both providers, since they shareBaseOAuth2. It ships inoauth2/v0.3.5.
Docs ¶
- Root
CLAUDE.mdis down from 30.9k to 5.2k characters. Subsystem gotchas now sit in aCLAUDE.mdbeside the code they cover.
Version 0.2.5 ¶
The OIDF FAPI 2.0 Security Profile plan now runs clean against the
reference server: 41 of 46 modules pass, the four that expect an error page
end in REVIEW with the right refusal, and the RS256 module is skipped since
FAPI clients use ES256 (issue 330). make testoidf enforces it (mission 98).
PAR and client assertions (issue 439, PR 446) ¶
- PAR answered
unauthorized_clientfor an unregisteredredirect_uri. It is now
invalid_request(RFC 9126 §2.3), as the OIDF plan expects. - Client assertions tolerate 10 seconds of clock skew on
iat,nbf
andexp(ClientAssertionClockSkew, FAPI 2.0 §5.3.2.1), andiatis
checked against the clock.
Refresh binding and PKCE errors (issue 443, PR 448) ¶
- A confidential client’s refresh token is no longer bound to its DPoP
key. RFC 9449 §5 binds only a public client’s refresh token, since a
confidential client authenticates every refresh. Before, a confidential
client that rotated its DPoP key couldn’t refresh. Access tokens stay
bound, and public clients are unchanged. - A missing
code_verifierisinvalid_grant(RFC 7636 §4.6), not
invalid_request. /authorize’s default error page carriesid="authorize-error".
The FAPI 2.0 plan in the ratchet (issue 447, PR 449) ¶
- Every module is judged against
tests/conformance/known-gaps.yaml, which
gains whole-moduleexpected-review(withevidencethe captured page
must contain) andexpected-skipstatuses for external suites. make testoidfruns the plan next to the discovery test, and it no longer
hangs waiting on the discovery server over plain http.make exercise-fapi2 MODULE=<substring>runs matching modules only.
FAPI signing on the reference server (issue 441, PR 450) ¶
jwt.ephemeral_signing_keyfollowssigning_alg: P-256 for ES256,
where it used to make an RSA key that ES256 refused at startup.fapi2: truerefuses anyjwt.signing_algbut ES256, the default
HS256 included (FAPI 2.0 §5.4.1).deploy-examples/fapi-dpop.yamlsigns ES256 fromJWT_PRIVATE_KEY_PATH
or a startup key, so its JWKS is no longer empty.
Upgrading ¶
cmd/oneauth-serverwithfapi2: trueneedsjwt.signing_alg: ES256
plusjwt.private_key_pathorjwt.ephemeral_signing_key: true, or it
refuses to start.- Code that matched
invalid_requestfor a missingcode_verifiershould
matchinvalid_grant. - Refresh tokens already issued to confidential clients stay bound until
they expire; new ones are unbound.
Version 0.2.4 ¶
Reference server TLS follows BCP 195 (issue 440, PR 445) ¶
- TLS 1.2 accepted suites outside BCP 195. With
tls.enabled, the
server used Go’s defaulttls.Config, which on TLS 1.2 still accepts the
ECDHE CBC and ChaCha20 suites. It now requires TLS 1.2 or later and, on
1.2, only RFC 9325 §4.2’s ECDHE + AES-GCM suites (FAPI 2.0 §5.2.1). TLS
1.3 is unchanged. - The FAPI 2.0 exercise registers its second client with the query suffix
the plan adds to that client’s redirect URI. It now passes 35 of 46
modules,happy-flowamong them.
Upgrading ¶
- Only
cmd/oneauth-serverwithtls.enabled: a TLS 1.2 client offering
only CBC suites can no longer connect. The library is unchanged.
Version 0.2.3 ¶
Reference server: the browser code flow works end to end (issue 438, PR 444) ¶
- Login dropped
next./authorizesends an unauthenticated user to
/auth/login?next=…, andcmd/oneauth-serveralways redirected a
browser login to/dashboard, so the code flow never reached consent.
The form now carriesnextand follows it when it’s a path on this site
(httpauth.LocalRedirect); anything else still goes to/dashboard. - Code and device-code redemption answered
unsupported_grant_type. The
server attached its code store, device store and AppStore toOneAuth
afterNewOneAuthhad built the granters, so they were never read. They
are now inOneAuthConfig. /api/*refused the server’s own RS256 / ES256 tokens. The middleware
knew only the HS256 secret; it now usesoa.Validator.main()is split intobuildServer(cfg)so tests drive the real server
in-process. The OIDF FAPI 2.0 exercise (make exercise-fapi2) goes from
10 of 46 modules passing to 33.
Upgrading ¶
- Library code is unchanged. Only
cmd/oneauth-serverdeployments with
code_flowordevice_flowenabled see different behavior: codes now
redeem, and the client authenticator checks each client’s registered
token_endpoint_auth_method. - The OIDF harness keeps MongoDB in a named volume; an old
tests/oidf-conformance/mongo/directory can be deleted.
Version 0.2.2 ¶
Introspection cnf; FAPI2 assertion grants (issue 434, PR 437) ¶
- Security: HTTP introspection omitted
cnf.IntrospectionHandler
never copied the token’s confirmation into its JSON, so a resource server
validating throughPOST /oauth/introspectaccepted a DPoP-bound token
presented as Bearer (RFC 9449 §6.2, §7.2). Bound tokens now carrycnf;
unbound ones carry none. Every version since 0.1.37 is affected. - Security:
FAPI2let assertion grants skip client authentication. A
jwt-bearer or token-exchange request with noclient_idreturned from the
confidential-client gate before its FAPI checks and got a token. Under
FAPI2such a request now authenticates the client its credentials name
(private_key_jwt’siss), which must be registered as confidential. - Docs. Every guide under
docs/oauth/, plusCONFORMANCE.mdand
OAUTH21_ALIGNMENT.md, is checked against the code and cites symbols
rather than line numbers (PR 435).
Upgrading ¶
- Resource servers that introspect now enforce DPoP binding: a bound token
sent as Bearer gets 401. FAPI2deployments: jwt-bearer and token-exchange requests without client
authentication get 401invalid_client.- Revoking a refresh token still leaves its access tokens valid until they
expire (#436).
Version 0.2.1 ¶
DPoPKey.ProofWithNonce (PR 432) ¶
- Callers with their own transport can answer a nonce challenge.
AuthClientretriesuse_dpop_nonceitself, but a caller that sets
Authorizationper request (mcpkit’s MCP transports) had onlyProof(),
which takes no nonce.ProofWithNonce(method, url, token, nonce)mints the
retry’s proof with the server’sDPoP-Nonce(RFC 9449 §8 / §9). An empty
nonce is the same asProof. Additive; nothing else changes.
Version 0.2.0 ¶
The code is 0.1.57’s. The minor version marks the breaking changes that
shipped across 0.1.38 to 0.1.57: exported API changes (AuthorizationCodeStore,
NewAuthorizationCodeGranter, oauth2 cookie arguments, the PAR and
verification-token store responses) and defaults that now fail closed. Each
version’s “Upgrading” section below lists them, and the GitHub release for
v0.2.0 collects them in one place. It is the first GitHub release since
0.1.37.
Version 0.1.57 ¶
Reused authorization codes revoke their tokens (issue 429, PR 431) ¶
- RFC 6749 §4.1.2. A redeemed code is marked used rather than deleted
and kept until its access token expires. Presenting it again blacklists
that token’sjti(withOneAuthConfig.Blacklist) and revokes the
refresh family; a reuse racing the first redemption makes that one
refuse too. AuthorizationCodeStoregainsConsumeAuthorizationCode
(ErrAuthorizationCodeUsed) andRecordAuthorizationCodeTokens;
in-memory and GORM implement both.CreateAccessTokenResponsecarries
TokenIDandExpiresAt.- GAE store tests run in CI (
gaejob,make testds, which now waits
for the emulator rather than sleeping).
Upgrading ¶
- Custom
AuthorizationCodeStoreimplementations need the two new methods. NewAuthorizationCodeGrantertakes acore.TokenBlacklist.- GORM adds five columns to
authorization_codesthrough AutoMigrate, and
used rows stay until their token expires.
Version 0.1.56 ¶
Security audit closed (issue 88, PR 430) ¶
- Docs only; code is identical to 0.1.55.
docs/SECURITY_AUDIT.mdopens with a summary: FAPI 2.0 Security Profile
readiness and its caveats, every finding by severity with the PR that
fixed it, the remaining gaps sized and linked to issues, and which test
layers run where.
Version 0.1.55 ¶
HTTP-surface follow-ups (issue 408, PR 428) ¶
- Signup doesn’t reveal existing accounts when
RequireEmailVerification
is on: a taken email gets the same “check your email” answer as a fresh
one (nouser_idin either), and the owner is told through the optional
AccountExistsEmailSender. - DCR initial access tokens (RFC 7591 §3).
admin.InitialAccessTokenAuth
asAppRegistrar.RegistrationAuthadmitsPOST /apps/dcrwithout the
admin key and opens nothing else; reference server:
admin_auth.dcr_initial_access_tokens(32 bytes minimum). - CSRF.
CSRFMiddlewarerefuses same-site and cross-site posts
(Sec-Fetch-Site,Origin,TrustedOrigins), and withSessionID
signs tokens over the session. The reference server binds them to the
login session with an HMAC-derived key and marks the cookie Secure
behind an httpspublic_url.
Upgrading ¶
- The verification-required signup response no longer carries
user_id. - Form posts from another origin need
TrustedOrigins. - Library users setting
CSRFMiddleware.SessionIDacross instances need a
sharedSecret.
Version 0.1.54 ¶
Reference server runs FAPI 2.0 (issue 88, PR 427) ¶
- PAR on the reference server.
code_flow.par.enabledmounts
POST /paron the code store’s backend;requiredrefuses direct
/authorize; metadata advertisespushed_authorization_request_endpoint
andrequire_pushed_authorization_requests. fapi2: truesetsOneAuthConfig.FAPI2. The server refuses to start
withoutdpop.enabled, or withcode_flowbut no PAR; metadata lists
private_key_jwt/ ES256 only and no password grant.
deploy-examples/fapi-dpop.yamlruns the whole profile.- FAPI assertion algorithms.
AuthenticateClientRequest.AllowedAssertionAlgs;
underFAPI2only PS256 / ES256 / EdDSA client assertions pass (ES256 is
the one oneauth can register today). - Keycloak parity. A revocation interop test pins the cross-client and
missing-token answers.
Upgrading ¶
FAPI2with RS256private_key_jwtclients: switch them to ES256 keys.fapi-dpop.yamlnow runs the full profile (private_key_jwt only, no
password grant, PAR for/authorize).
Version 0.1.53 ¶
Docs only; the code is v0.1.52’s. This tag was cut early by mistake, before
PR 427 (the reference server’s PAR endpoint and fapi2 switch) had merged;
that work ships in 0.1.54.
Version 0.1.52 ¶
FAPI 2.0 profile; client-assertion audiences (issue 88, PR 426) ¶
- Security: a caller could choose the audience its client assertion was
checked against. The expectedaudcame fromX-Forwarded-Host/
X-Forwarded-Proto, so an assertion minted for another authorization
server (same client key) was accepted. Audiences now come fromr.TLS
andr.Hostonly, and the token endpoint also accepts the issuer by
default (RFC 7523 §3). The reference server setsAcceptedAudiencesfrom
jwt.issuerandpublic_url. OneAuthConfig.FAPI2turns on the FAPI 2.0 Security Profile §5.3.2:
DPoP required, rotation off,private_key_jwtonly with the issuer as a
stringaud, no password grant, no public or unregistered clients, and a
PAR-onlyMountAuthorizewith capped code /request_urilifetimes.
Upgrading ¶
- Behind a TLS proxy, set
AcceptedAudiencesif clients put the https
token-endpoint URL inaud; forwarded headers no longer supply it.
Version 0.1.51 ¶
FS key collisions, server metadata, multi-AS resource metadata (issue 88, PR 425) ¶
- Security: FS identity and channel stores could serve one account’s
records for another key. File names are lossy (filepath.Basefor
identities,safeNamefor channels), sox/email:victim@example.com
read and, on save, overwrote the victim’s identity, and
email:a:b@example.comreademail:a_b@example.com’s password hash.
Both stores now check that a file’s record belongs to the requested key,
on read and write, and returnfs.ErrKeyCollisionotherwise. Every
earlier version using the FS stores is affected; file names don’t change. - Reference server metadata advertises
code, RFC 9207issand the
noneauth method only withcode_flow, drops the implicittoken
response type, mounts the advertisedPOST /oauth/revoke, and emits
isson authorize redirects. MountProtectedResourcemounts each pattern once, so several
authorization servers no longer panic.
Upgrading ¶
- FS deployments: an email that collides with an existing identity’s file
is refused withErrKeyCollision. - Reference-server clients see
isson authorization responses.
Version 0.1.50 ¶
DCR validation and per-client PAR (issue 88, PR 424) ¶
- Redirect URIs with userinfo or no https host are refused, and every
redirect problem answersinvalid_redirect_uri(ErrInvalidRedirectURI,
which wrapsErrInvalidClientMetadata). - Auth methods and grant types are checked against what the token
endpoint supports and against each other, on register and update. - Default auth method is
client_secret_basic(RFC 7591 §2), stored
and echoed alike; anoneclient gets no secret. - DCR server errors are logged, not returned.
require_pushed_authorization_requests(RFC 9126 §6) through DCR,
core.AppRegistration, the FS / GORM / GAE app stores and the client
SDK;/authorizeenforces it.
Upgrading ¶
- Registrations with bad redirect URIs, unknown methods or grants, or
authorization_codewithout a redirect URI are refused. - The echoed default method is
client_secret_basic. - GORM adds a
require_pushed_authorization_requestscolumn on migrate.
Version 0.1.49 ¶
Authorize, PAR, PKCE and the device flow (issue 88, PR 423) ¶
- PAR works through the consent screen. The consent form round-trips
request_uri, so Approve resolves the pushed payload; before, it re-read
the hidden inputs as a fresh request, never spent the reference, and
failed outright withRequirePushedRequests. - One code per pushed request.
IssueCodespends the reference before
minting;ConsumePushedAuthorizationRequestResponse.Consumedis true for
exactly one caller. request_urirequiresclient_id(RFC 9126 §4).- PKCE shape (RFC 7636): an S256 challenge is 43 base64url characters;
a plain challenge and every verifier 43 to 128 unreserved characters. - Registered scope applies at
/authorize(invalid_scopeon the
redirect) and device authorization (400). /authorizewithout a client registry refuses unless
AllowAnyRedirectURI(onAuthorizationHandleror
AuthorizeMountConfig).
Upgrading ¶
- Custom consent templates must post
request_uriback. - Mounts with neither
AppStorenorRedirectURIValidatorneed one, or
AllowAnyRedirectURIin tests. - Custom
PushedAuthorizationRequestStores must setConsumed. - Malformed PKCE values are refused.
Version 0.1.48 ¶
Input validation at the token endpoint (issue 88, PR 422) ¶
- Registered scope and RAR types are enforced. With an
AppStore,
client_credentialsand the password grant answer 400invalid_scope
for a scope outsideAppRegistration.Scope(and grant the registered
scope when none is asked for), and 400invalid_authorization_details
for an unregistered type. A registration without either places no limit;
a store error fails closed. client_credentialstokens carryclient_id.- RFC 6749 §5.2 errors. Wrong credentials are 400
invalid_grant;
malformedauthorization_detailson the password grant is 400, not 500;
aninvalid_client401 carriesWWW-Authenticate: Basic; a
server_errorlogs its detail and sends “internal server error”. - Bodies are bounded at 64 KiB on the token endpoint (413) and, via
httpauth.CapRequestBody, on every other handler that reads one.
Upgrading ¶
- Clients registered with a
scopethat ask for something else get 400. - A wrong password on the password grant is 400, not 401.
- Request bodies over 64 KiB are refused.
Version 0.1.47 ¶
Key management, part two (issue 88, PR 420) ¶
- Rotation grace periods work.
OneAuthConfig.KidStoresits behind
KeyStorein the validator’s lookup, so a token signed with a rotated
key verifies until its grace period ends. The reference server builds a
kid store on the key store’s backend (FS under<path>/kids), gives it to
AppRegistrarandOneAuth, and sweeps expired keys every 10 minutes.
Before, it had none, andgrace_periodwas accepted and ignored. - Retired keys are encrypted.
EncryptedKidStorageapplies
EncryptedKeyStorage’s format and rules toKidStorage; the reference
server wraps its kid store under the same master key. - RSA keys under 2048 bits are refused at load (
utils.CheckRSAKeySize
in the PEM and JWK parsers), remote JWKS included. - JWKS 304s keep
ETagandCache-Control, andIf-None-Matchtakes
lists,*and weak tags. make auditruns gitleaks, govulncheck and gosec at pinned versions
viago run; CI pins govulncheck too.- Deploy examples
memory.yamlandfapi-dpop.yamlletjwt.issuer
followpublic_url.
Upgrading ¶
- Short RSA keys (under 2048 bits) fail when loaded, including keys a
remote JWKS publishes. - Reference server with
fskeys writes retired keys under
<path>/kids. memory.yaml/fapi-dpop.yamlissue tokens with the public URL as
issunlessJWT_ISSUERis set.- Retired asymmetric keys aren’t yet published in JWKS during their grace
period (#421).
Version 0.1.46 ¶
Keys, ID tokens and CodeQL (issue 88, PRs 417 to 419) ¶
- Encrypted key storage fails closed.
EncryptedKeyStoragereturns
keys.ErrKeyDecryptfor a record it can’t open, where it used to return
the stored bytes as the key. Records are written asoaenc1:+ nonce +
AES-256-GCM with AAD over client, alg and kid, so a ciphertext copied into
another record won’t open. Plaintext secrets needAllowLegacyPlaintext,
andMigrateLegacyrewrites old records. The reference server runs it
once withkey_store.migrate_legacy(KEYSTORE_MIGRATE_LEGACY=true). - OIDC ID tokens aren’t access tokens. Keycloak signs ID tokens with
the same key, header andaudas access tokens; atypclaim other than
Bearer/DPoPis now refused. - Cookies. Every cookie in
oauth2,federatedauthand the demo app,
deletes included, is Secure + HttpOnly + SameSite=Lax, andhttpauth’s
loggedInSubjectis HttpOnly.LocalRedirectrebuilds its target from
the parsed path, query and fragment. - Workflows run with a read-only
GITHUB_TOKEN.
Upgrading ¶
- Encrypted key stores holding plaintext secrets: start once with
key_store.migrate_legacy: true, or setAllowLegacyPlaintextand call
MigrateLegacy. Until then those clients fail withErrKeyDecrypt.
Records written now can’t be read by older versions. oauth2: dropBaseOAuth2.SecureCookiesand thesecureargument to
OauthRedirectorWithPKCE/SetPKCECookie. Social login over plain http
works only on localhost.- Pages reading
loggedInSubjectfrom script no longer can. - Non-oneauth issuers whose access tokens carry a
typclaim other than
Bearer/DPoPare refused.
Version 0.1.45 ¶
Token audit (issue 88, PRs 414 to 416) ¶
Issue 88’s third slice walked token validation, revocation and
introspection. The matrix is the “Tokens and keys” section of
docs/SECURITY_AUDIT.md.
- Validation.
expis required. An empty HMAC key never signs or
verifies. Logout tokens, ID-JAGs and sessions are refused as access tokens
bytypheader andtypeclaim. A key registered to a client verifies
only tokens carrying thatclient_id, and a token with the validator’s own
kidis checked with its own key (it used to be checked against the
named client’s key and fail).CustomClaimscan’t setnbf,scope,
azp,sid,actormay_act. - Challenges.
invalid_tokenonly when a token was presented, 403
insufficient_scopewithscopefor a missing scope, and
resource_metadatafromAPIMiddleware.ResourceMetadataURL. - Revocation. A client revokes only its own tokens (
ErrRevokeNotOwner,
400invalid_request, as Keycloak answers). Access tokens are verified
before theirjtiis blacklisted, a missingtokenis 400, and every
token type is searched whatever the hint. - Introspection.
token_typeisBearer/DPoP, and refresh tokens
can be introspected (NewTokenIntrospectorWithRefreshStore, wired by
OneAuth). - Grants. jwt-bearer assertions need
expand a configured audience,
and one with ajtiis single-use. A code redeemed by two requests at
once gives the loserinvalid_grant, and tokens from a code carry
client_id. - Refresh tokens. GORM rotation is a compare-and-set, and rotation keeps
the family’s expiry in every store. - Sessions.
httpauthand the reference server accept only
type: sessionJWTs as logins. The reference server refuses a
jwt.secret_keyunder 32 bytes. - CodeQL. The three error-level alerts are fixed: no token prefix in
httpauth’s log, and no unverified JWT parse in the revoker or the
server’s/api/revoke.
Upgrading ¶
- Tokens without
expno longer validate. oneauth always set it. - Missing scope is 403, not 401.
- Reference server:
jwt.secret_key(JWT_SECRET_KEY) must be at least
32 bytes, in every signing mode. - Tenant-minted tokens must carry their own
client_id. - Refresh sessions end
TokenExpiryRefreshToken(7 days) after login,
however often they’re refreshed. - jwt-bearer / token-exchange: set
TrustedAssertionIssuer.Audiencesor
the AS issuer URL, or every assertion is refused. - Introspection consumers reading
token_typeseeBearer/DPoP. - Revocation without
tokenis 400.
Version 0.1.44 ¶
HTTP-surface audit (issue 88, PRs 403 to 407) ¶
Issue 88’s second slice walked transport and headers, sessions and the admin
interface after the first ZAP scan. The matrix is in docs/SECURITY_AUDIT.md.
- Credentials on the wire.
Cache-Control: no-storeon every response
that carries a secret: DCR, admin read / list / rotate, API-key creation,
token and device errors, the authorize redirect, the reset form. The admin
view no longer returns clients’registration_access_token. DCR builds
registration_client_urifromAppRegistrar.IssuerBaseURL, never a
non-loopbackHostheader. - Sessions.
httpauthlogin cookies are Secure (opt-out
InsecureCookies), SameSite=Lax and, for the JWT, HttpOnly. The session
is renewed at login and logout, every cookie domain is served, and session
JWTs carrytype: sessionso APIs refuse them as Bearer tokens. A missing
secret now means a random per-process one, where it used to be a fixed
public string. Logout is POST, and logout / post-login redirects only go
to local paths.httpauth.DenyFramingkeeps the consent, device and
password pages out of other sites’ frames. - Brute force.
core.ClientIPbelievesX-Forwarded-Foronly from
configuredTrustedProxies. The password grant has a lockout
(TokenEndpointHandler.Lockout), signup and forgot-password are limited,
andMountDeviceFlowalways limits user-code entry. - Fail-closed defaults. A nil
AdminAuthanswers 401. Admin bodies are
capped at 64 KiB, admin requests are rate limited before the key is
checked, and a rotation grace period is at most 7 days. - Password reset. Every store keeps verification tokens as SHA-256
hashes, a link works once even when two requests race, a reset applies
the signup password policy, andAfterPasswordReset
(NewRevokeSessionsOnReset) ends the account’s other sessions. - Reference server. Rate limiting is on by default (
rate_limit,
server.trusted_proxies). The server won’t start with an unset
admin_auth.type, withnoneunlessallow_open: true, or with a
plain-http public URL on a non-loopback host unlessallow_insecure_http.
jwt.issuerdefaults to the public URL. Pages load a prebuilt stylesheet
(make server-css), and the CSP allows only'self'.
Upgrading ¶
AdminAuth: passNewNoAuth()for open admin routes; nil now refuses.- DCR behind a real host: set
AppRegistrar.IssuerBaseURL, or registration
answers 500. httpauth: setONEAUTH_JWT_SECRET_KEY(orJWTSecretKey), or
sessions end on restart. UseInsecureCookiesfor plain-http development
away from localhost. Link to/logoutwith a POST form.- Reference server: set
admin_auth.type, and an httpspublic_url(or
allow_insecure_httpon a private network). List your proxies in
server.trusted_proxies. - Custom
VerificationTokenStores must set
DeleteVerificationTokenResponse.Deleted. Reset links issued before the
upgrade stop working. iss: tokens from the reference server carry the public URL unless
jwt.issueris set.
Version 0.1.43 ¶
DPoP and FAPI follow-ups (issue 395, PRs 400 to 402) ¶
- The SDK’s automatic refresh works against any RFC 8414 server. With AS
metadata (WithASMetadata) it posts the standard refresh form to the
discovered token endpoint instead of oneauth’s own/auth/cli/token, which
Keycloak and others don’t serve. client.WithClientSecret(secret)lets the automatic refresh
authenticate a confidential client, which the refresh grant has required
since 0.1.41. The secret stays in memory and never reaches the credential
store.- A request retried after a refresh keeps its body. One whose body can’t
be rewound gets the 401 back instead of being resent empty. - EdDSA (Ed25519) DPoP proofs are accepted by default and by
FAPIDPoPAlgs(), now ES256, EdDSA and PS256.utilshandles RFC 8037 OKP
keys, and the SDK hasNewEd25519DPoPKey/NewDPoPKeyFromEd25519.
Keycloak computes the same thumbprint. OneAuthConfig.DisableRefreshTokenRotationkeeps a refresh token in use
across refreshes, as FAPI 2.0 §5.3.2.1 asks. The response then carries no
refresh_token. The default still rotates.cmd/oneauth-servercan turn DPoP on, with adpop:block (profile or
algs, require at the token endpoint and at the API, nonces with a shared
secret) andjwt.disable_refresh_token_rotation.
deploy-examples/fapi-dpop.yamlturns all of it on.
Repo ¶
- The GAE store tests are deterministic. The Datastore emulator now starts
with--consistency=1.0; at its default of 0.9, 9 of 10make testdsruns
failed. - Every Go file is gofmt-clean and CI checks it.
make fmtfixes;
.git-blame-ignore-revskeeps the cleanup commit out of blame.
Upgrading ¶
DPoPKeycallers: no exported API changed, but a validator using the
default algorithm list now also accepts Ed25519 proofs. Set
DPoPConfig.AllowedAlgsto refuse them.- SDK clients with AS metadata now auto-refresh against the discovered
endpoint. A confidential client needsWithClientSecretto do so.
Version 0.1.42 ¶
Fixes found by comparing with Keycloak (issue 88, PR 398) ¶
New full-stack e2e tests and a suite that sends the same requests to Keycloak
and to oneauth turned up three bugs.
LoginWithBrowserwith a DPoP key can log in. It sentdpop_jkt, which
binds the code to the key, then exchanged the code without a proof, so
oneauth and Keycloak both refused every DPoP browser login. The exchange now
carries a proof and answers nonce challenges, still through the caller’s
HTTPClient.- Refresh
invalid_grantis 400, as RFC 6749 §5.2 has it. It was 401. - A refresh naming no client for a token that has one gets 401
invalid_client, and one naming a different client getsinvalid_grant
before any credentials are asked for. Both match Keycloak. - SDK DCR carries
DPoPBoundAccessTokensonClientRegistrationRequest
andClientRegistrationResponse(RFC 9449 §5.2).
Where oneauth and Keycloak still answer differently, docs/SECURITY_AUDIT.md
says which and why.
Upgrading ¶
- Code that branches on the refresh grant’s status sees 400 instead of
401 for a refused token. Onlyinvalid_clientis 401.
CI ¶
The ZAP baseline scan runs again. Its pinned action version didn’t exist, so
the job had failed at setup on every push to main. It now reports to the run’s
zap_scan artifact rather than opening issues.
Version 0.1.41 ¶
DPoP audit and requiring DPoP (issue 88, PR 396) ¶
We walked RFC 9449 and the DPoP parts of FAPI 2.0 against the code, one
requirement at a time. The matrix is in docs/SECURITY_AUDIT.md, also on the
site under Conformance. The walk turned up a few bugs and one missing feature.
- Requiring DPoP.
OneAuthConfig.RequireDPoPmakes the token endpoint
refuse any request without a proof (FAPI 2.0 §5.3.2.1). A client registered
withdpop_bound_access_tokens(RFC 9449 §5.2) is held to it on its own.
The field is oncore.AppRegistrationand DCR. Either way a missing proof
gets 400invalid_dpop_proof, never a bearer token. - PAR with a shared validator.
/parchecks a proof’shtuagainst its
own URL, soMountAuthorizegiving it the token endpoint’s validator works.
Before, every correct PAR proof failed behind a proxy, and a proof made for
the token endpoint was accepted at/par. PAR also answers a nonce
challenge withuse_dpop_nonceandDPoP-Nonce. htucomparison follows RFC 3986 §6.2 normalization (case, default
ports, percent-encoding, dot segments).- RSA proof keys under 2048 bits are refused,
jtiis capped at 256 bytes, and
apiauth.FAPIDPoPAlgs()returns ES256 and PS256. - SDK. The automatic refresh now carries a proof, so a DPoP client can
redeem its own bound refresh token. ADPoP-Nonceon any response is kept
for the next request. - GORM and GAE app stores now persist
dpop_bound_access_tokens, and the
backchannel_logout_uri/backchannel_logout_session_requiredsettings
they used to drop, which switched off back-channel logout after a restart.
The refresh grant checks the client (issue 395, PR 397) ¶
The refresh grant used to check only the token, so a leaked refresh token
redeemed under any client_id, or none, and a confidential client’s token
redeemed without its secret (RFC 6749 §6).
- If the token’s owner is registered confidential, the request has to
authenticate as a client, or it gets 401invalid_client. - The token must belong to the presenting
client_id, or the grant answers
invalid_grantbefore rotating, so a refused attempt doesn’t use up the
owner’s token. A token stored with no client still redeems. RefreshGrantRequest.ClientIDcarries the presenting client for library
callers ofTokenIssuer.RefreshGrant.- The shared confidential-client check treats an AppStore error other than
not-found as a 500, where it used to treat the client as public. This also
reaches jwt-bearer, token-exchange and PAR. - SDK.
ServerCredential.ClientIDrecords which client a credential was
issued to, and the automatic refresh sends it instead of"cli".
Upgrading ¶
- GORM deployments need
AutoMigratefor the new app-registration columns
(dpop_bound_access_tokensand the two back-channel logout fields). - Refresh callers must send their
client_id, and confidential clients
their credentials. Callers that leftclient_idoff, or sent another one,
are now refused. - The SDK’s automatic refresh sends no client secret, so a confidential
client logged in withLoginWithBrowserand aClientSecretcan’t
auto-refresh. CallRefreshTokenwith the secret (issue 395 item 4).
Version 0.1.40 ¶
Typed login and token errors (issues 392, 393, PR 394) ¶
A caller can now tell why a login failed without matching on text. That’s
what mcpkit needs to re-register a client the server has forgotten, without
showing the consent page again to someone who clicked Deny.
LoginWithBrowserreturns*AuthorizeError(the AS refused
/authorize),*CallbackError(?error=on the redirect, e.g.
access_denied),*TokenError(the code exchange failed),
*BrowserOpenError(the opener failed, unwrapping to its cause) and
ErrLoginTimeout. Useerrors.As/errors.Is. The messages are the same
as before.*TokenErrorfrom every grant:Login,ClientCredentials,
RefreshToken,JwtBearerGrant,TokenExchange,DeviceAuthorization,
andPollDeviceTokenfor codes other than its four RFC 8628 sentinels.
A token endpoint that answers with a non-JSON error page now reports its
status instead of a JSON decode error.- JSON
/authorizeerrors. oneauth’s error page for an unknown client or
unregisteredredirect_urianswers with the RFC 6749 §5.2 JSON object
whenAcceptlistsapplication/json.FollowRedirectsand
ApproveConsentsendAccept: text/html, application/json;q=0.9, so they
getAuthorizeError.Codefrom oneauth and from Keycloak. For servers that
only send HTML,AuthorizeError.Bodyis the page’s visible text.
Version 0.1.39 ¶
Documentation only; the code is the same as 0.1.38. The client SDK guide
covers the caller-owned listener, RedirectURI, ApproveConsent and the
fail-fast FollowRedirects, and its browser-login snippets use the current
LoginWithBrowser(ctx, &BrowserLoginRequest{...}) signature.
CAPABILITIES.md, the roadmap and the Keycloak test README are brought up to
date, and these notes now cover 0.1.38.
Version 0.1.38 ¶
DPoP, the rest of RFC 9449 ¶
0.1.37 shipped DPoP-bound tokens on both sides. This release finishes the
spec and gives the client SDK the means to use it.
dpop_jkton/authorize(PR 378). The authorization code is bound to
the client’s DPoP key, so an intercepted code can’t be redeemed with a
different one (§10). A missing proof against a bound code is
invalid_grant.- Client SDK proofs (PR 379).
client.DPoPKey(ES256) mints a proof per
request, andWithDPoPKeyattaches proofs to token requests, presents
tokens under theDPoPscheme withath, and sendsdpop_jkton browser
login. - The nonce protocol (PR 384).
DPoPConfig.NoncePolicywith a stateless
HMACNonceSourcelets the AS (§8) and the resource server (§9) demand a
server-supplied nonce; the SDK retriesuse_dpop_nonceautomatically. Off
by default. - Keycloak interop (PR 385). OneAuth’s middleware accepts a
Keycloak-issued bound token and refuses it presented as Bearer.
Pushed authorization requests (RFC 9126, PR 381) ¶
POST /par stores the authorization request and returns a request_uri, and
/authorize accepts a request carrying only client_id + request_uri.
Mounted by MountAuthorize when AuthorizeMountConfig.PushedStore is set,
with in-memory and GORM stores. A push may carry a DPoP key in its header or
as dpop_jkt (RFC 9449 §10.1).
Loopback redirects for native clients (PR 388) ¶
- Caller-owned listener (issue 387).
BrowserLoginRequest.Listenertakes
a loopback listener the caller already bound, and
LoopbackRedirectURI(addr)names the redirect the login will send. A
client that registers via DCR first registers exactly that string, so an AS
that matchesredirect_uribyte-for-byte accepts it, and nothing can take
the port between registration and login.LoginWithBrowsercloses the
listener when it returns. RedirectURIsends a registered redirect verbatim (an IP literal, a
path other than/callback). It must be loopbackhttpwith an explicit
port matching the listener, checked before the browser opens.FollowRedirectsfails fast. A 400-or-worse from/authorizenow
returns the AS’serror/error_description. Before,LoginWithBrowser
sat out its timeout (five minutes by default) waiting for a callback that
was never coming.ApproveConsentis a headless opener for demo servers that answer
/authorizewith a consent form. It posts the approve button and refuses a
form without one.- Behavior change on the AS (issue 389).
/authorizenow ignores the port
when matching anhttpredirect on 127.0.0.1, [::1] or localhost, as
RFC 8252 §7.3 requires; scheme, host, path and query still match exactly.
Deployments relying on the old exact port match for loopback clients will
now accept any port.apiauth.RedirectURIMatchesis exported for custom
RedirectURIValidators.
Tooling and CI ¶
- The Go directive is 1.26.9 across all modules (GO-2026-6617, an HTTP/2
HPACK race innet/http), withgolang.org/x/netv0.60.0 where it’s
pulled in (PR 388).go.opentelemetry.io/otel/sdk1.45.0 (PR 376). - The Keycloak interop workflow runs
make testkcland triggers on relevant
PRs (PR 390). It had never got past starting Keycloak before. The test
realm defines Keycloak’sbasicscope so tokens carrysubon 25+, and
test-confidentialnames itself inaudso 26.x lets it introspect. - The docs site renders mermaid diagrams and publishes the spec library and
guides (PR 383).
Version 0.1.37 ¶
DPoP — sender-constrained access and refresh tokens (RFC 9449) ¶
A token can now be bound to a key the client holds, so a leaked token is
unusable by whoever leaks it. Both halves ship together: the authorization
server binds the token, and the resource server refuses to honor it unless the
presenter proves the key.
Everything here is off by default. An existing deployment that wires neither
side behaves exactly as it did in 0.1.36.
Issuance (PR 370). Set OneAuthConfig.DPoP to a DPoPProofValidator and
the token endpoint starts accepting a DPoP proof header on any grant. A
request that carries a valid proof gets cnf.jkt in the access token,
token_type: DPoP in the response, and a refresh token only that key can
rotate. A request with no proof gets exactly what it got before.
- Proof validation per §4.3:
typ, an asymmetricalgallow-list (ES256,
RS256, PS256 by default; symmetric algorithms can never be enabled), the
embedded publicjwkwith private members rejected, the signature,htm,
htu, aniatwindow, andjtireplay through the existingJTIStore. - Refresh-token binding persists in all three backends (FS, GORM, Datastore)
and is carried forward on rotation. A bound refresh token presented without
its key isinvalid_grant. dpop_signing_alg_values_supportedon authorization-server metadata.
Enforcement (PR 372). Set APIMiddleware.DPoP and the resource server
accepts Authorization: DPoP <token> with a per-request proof, checks the
proof’s ath against the presented token, and matches the proof key against
the token’s cnf.jkt.
- A bound token presented under the
Bearerscheme is refused, per §7.2.
Without that check a thief drops theDPoPheader and the binding buys
nothing. WWW-Authenticateadvertises both schemes, with error information on the
scheme the client actually used.APIMiddleware.RequireDPoPrefuses bearer presentations outright, backing
dpop_bound_access_tokens_requiredon protected-resource metadata
(RFC 9728), which lands alongsidedpop_signing_alg_values_supported.- Introspection responses carry
cnf, so a resource server that validates
remotely enforces the same binding as one validating the JWT locally.
Rollout order. A resource server with APIMiddleware.DPoP unset accepts a
bound token as an ordinary bearer token, which RFC 9449 §7.2 both predicts and
permits. Wire enforcement at the resource servers first, then start issuing
bound tokens. The reverse order leaves a window where the binding protects
nothing.
Deployment note (GORM). The refresh_tokens table gains a
confirmation_jkt column. Run AutoMigrate before deploying. The column is
empty for existing rows, which reads back as an unbound token, so current
behavior is preserved. Datastore adds an equivalent optional property and
needs no migration.
API additions. core.Confirmation (the RFC 7800 cnf claim as a type),
CreateAccessTokenRequest.Confirmation, CreateAccessTokenResponse.TokenType,
RefreshGrantRequest.Confirmation and the same field on each grant request
type, TokenInfo.Confirmation, IntrospectionResult.Cnf, and
IntrospectionValidator.ValidateInfo. The confirmation is a struct rather
than a bare thumbprint string so that mTLS certificate binding (x5t#S256,
issue 335) adds a field instead of a second parameter on every issuance path.
One behavior change without a flag. cnf is now a standard claim, so it
no longer appears in TokenInfo.CustomClaims. Code reading cnf out of the
custom-claims bag should read TokenInfo.Confirmation instead. This also stops
a deployment’s CustomClaimsFunc from writing a binding the server never
verified.
Conformance. Validated against the RFC’s own published vectors: the
Figure 2 proof and the Figure 9 thumbprint it produces, plus the Figure 13
access token and the Figure 14 ath computed from it.
Closes issue 336. Remaining RFC 9449 surface: the nonce protocol (§8, §9) and
dpop_jkt on the authorization request (§10). Keycloak interop for the
resource-server half is issue 371.
Documentation ¶
Coverage tables that still listed DPoP as a gap are corrected (RFC_9449.md,
RFC_9728.md, the Authlete gap analysis, the FAPI readiness note), and
ROADMAP.md records the two PRs with the design decisions behind them
(PR 373). CAPABILITIES.md gains the dpop-sender-constrained-tokens entry.
testutil’s WithConfidentialClient is documented in its sidecar (PR 367).
Dependencies ¶
Grouped go_modules security bumps across the workspace (PRs 368, 369).
Version 0.1.6 ¶
Convention closure for issues 175 + 172 ¶
The (ctx, *XRequest) → (*XResponse, error) convention adopted across the library (CLAUDE.md “gRPC-shape convention everywhere”) is now closed-loop for apiauth/ and admin/:
apiauth/: all five transport-agnostic interfaces (TokenIssuer,TokenValidator,TokenIntrospector,TokenRevoker,ClientAuthenticator) follow the convention. HTTP handlers are thin wrappers. Four legacy positional methods onAPIAuth—CreateAccessToken,ValidateAccessToken,ValidateAccessTokenFull,VerifyTokenFunc— are now marked// Deprecated:and point at the canonical interface methods. They remain as the internal implementation backing the HTTP handlers; consolidation + outright removal is tracked under issue 218.admin/:ClientRegistrarinterface (Register / RegisterLegacy / ListClients / GetClient / DeleteClient / RotateSecret) is in shape, implemented onAppRegistrar, and covered by pure-Go interface tests (client_admin_test.go) that bypass HTTP entirely.ClientRegistrationManager(RFC 7592 self-service) already adopted the convention via issues 168/169/170.
Documentation updated: apiauth/SUMMARY.md now carries the convention paragraph that admin/SUMMARY.md already had.
Closes 175, 172. Follow-up consolidation tracked under 218. Client SDK migration tracked under 217.
Version 0.1.5 ¶
Client SDK — RFC 8693 token exchange + RFC 7523 §2.1 JWT bearer grant ¶
Two new general-purpose OAuth primitives on AuthClient. Both are additive — no existing behavior changes.
AuthClient.TokenExchange(*TokenExchangeRequest) — RFC 8693. Exchange a subject token (plus optional actor token / requested type / audience / resource / scope) for a freshly issued token. Returns TokenExchangeResponse including IssuedTokenType (required by RFC 8693 §2.2). Useful for bridging trust domains — e.g. exchanging an upstream-IdP ID token for an internal ID-JAG.
AuthClient.JwtBearerGrant(*JwtBearerGrantRequest) — RFC 7523 §2.1. Present a signed JWT (typically the output of a prior token exchange or trusted upstream issuance) as assertion at the token endpoint to obtain an access token. Distinct from the private_key_jwt client authentication method, which authenticates the client itself — both can coexist in the same request.
Both methods reuse the existing AuthClient client-authentication negotiation: client_secret_basic, client_secret_post, and private_key_jwt (via ClientAssertionConfig) all work transparently.
Wire shape: application/x-www-form-urlencoded with the appropriate grant_type value. audience and resource are emitted as repeated form values per RFC 8693 §2.1 / RFC 8707 §2. scope is space-delimited per RFC 6749 §3.3.
Tests: 5 unit tests covering wire shape + minimal request omission + all three client-auth methods, plus 2 e2e tests against the in-process testutil.TestAuthServer with TrustedAssertionIssuers configured.
Near-term consumer: mcpkit’s SEP-990 enterprise-managed authorization (mcpkit issue 448), which chains these two primitives in an EnterpriseManagedTokenSource with two-stage caching.
See issue 213.
Version 0.1.4 (PR 2b — Subject vocab consumer-side rename) ¶
Subject vocabulary — phase 2: consumers, helpers, transports ¶
Breaking. Completes the rename started in v0.1.3 (PR 2a). All Go API surfaces that handle the principal-of-a-token concept now use Subject — context helpers, scope callbacks, response types, HTTP middleware methods, gRPC functions, gRPC metadata header, and the session cookie key. Account-model types (accounts.User, accounts.Identity.UserID, accounts.Username.UserID, etc.) stay as UserID — see v0.1.3 notes.
Go API renames:
| Before | After |
|---|---|
core.GetUserIDFromContext(ctx) |
core.GetSubjectFromContext(ctx) |
core.SetUserIDInContext(ctx, ...) |
core.SetSubjectInContext(ctx, ...) |
core.DefaultUserParamName = "loggedInUserId" |
core.DefaultSubjectParamName = "loggedInSubject" |
core.GetUserScopesFunc / DefaultGetUserScopes |
core.GetSubjectScopesFunc / DefaultGetSubjectScopes |
apiauth.APIAuth.GetUserScopes |
apiauth.APIAuth.GetSubjectScopes |
apiauth.OneAuthConfig.GetUserScopes |
apiauth.OneAuthConfig.GetSubjectScopes |
apiauth.JWTIssuerConfig.GetUserScopes |
apiauth.JWTIssuerConfig.GetSubjectScopes |
apiauth.PasswordGrantResponse.UserID |
.Subject |
apiauth.TokenInfo.UserID |
.Subject |
apiauth.GetUserIDFromAPIContext(ctx) |
GetSubjectFromAPIContext(ctx) |
httpauth.Middleware.UserParamName |
SubjectParamName |
httpauth.Middleware.GetLoggedInUserId(r) |
GetLoggedInSubject(r) |
httpauth.OneAuth.SetLoggedInUserID(...) |
SetLoggedInSubject(...) |
grpc.UserIDFromContext / UserIDFromContextWithConfig |
SubjectFromContext / SubjectFromContextWithConfig |
grpc.UserIDToOutgoingContext / WithKey |
SubjectToOutgoingContext / WithKey |
grpc.DefaultMetadataKeyUserID = "x-user-id" |
DefaultMetadataKeySubject = "x-subject" |
grpc.Config.MetadataKeyUserID |
MetadataKeySubject |
Active sessions invalidated. The session-cookie key flipped from loggedInUserId to loggedInSubject. Cookies issued by v0.1.3 and earlier are not recognised by v0.1.4 — affected users will be prompted to log in again. No code or data migration needed; the new cookies are issued on next login.
gRPC clients/servers must upgrade in lock-step. The metadata header changed from x-user-id to x-subject. A v0.1.4 server will not see subjects sent by a v0.1.3 client (and vice versa).
SwitchUser* stays. grpc.SwitchUserToOutgoingContext, SwitchUserToOutgoingContextWithKey, MetadataKeySwitchUser, and DefaultMetadataKeySwitchUser = "x-switch-user" are unchanged — impersonation is human-user-scoped by nature.
Combined with v0.1.3, this completes the Subject vocab rename across the library.
Version 0.1.3 (PR 2a — token Subject foundation) ¶
Subject vocabulary — phase 1: token-bearing types ¶
Breaking. The token-bearing types in core/ and localauth/ now use Subject (RFC 7519 sub) for the principal field, replacing UserID. Motivation: in client_credentials flows the principal is a service account, not a human user — UserID was misleading. Subject is what the JWT sub claim, RFC 7662 introspection, RFC 8693 token exchange, and Spring Security / JWT / X.509 idiom all call this concept. Account-model types (accounts.User, accounts.Identity.UserID, accounts.Username.UserID) stay as UserID — those are application user records, not OAuth subjects.
Go API renames:
| Before | After |
|---|---|
core.RefreshToken.UserID (json:"user_id") |
core.RefreshToken.Subject (json:"subject") |
core.APIKey.UserID (json:"user_id") |
core.APIKey.Subject (json:"subject") |
localauth.VerificationToken.UserID (json:"user_id") |
localauth.VerificationToken.Subject (json:"subject") |
RefreshTokenStore.CreateRefreshToken(userID, ...) |
CreateRefreshToken(subject, ...) |
RefreshTokenStore.RevokeUserTokens(userID) |
RevokeSubjectTokens(subject) |
RefreshTokenStore.GetUserTokens(userID) |
GetSubjectTokens(subject) |
APIKeyStore.CreateAPIKey(userID, ...) |
CreateAPIKey(subject, ...) |
APIKeyStore.ListUserAPIKeys(userID) |
ListSubjectAPIKeys(subject) |
VerificationTokenStore.CreateToken(userID, ...) |
CreateToken(subject, ...) |
VerificationTokenStore.DeleteUserTokens(userID, ...) |
DeleteSubjectTokens(subject, ...) |
All three backends (stores/fs, stores/gorm, stores/gae) updated. Models renamed in lock-step.
Storage migration required. GORM column renames: refresh_tokens.user_id → subject, api_keys.user_id → subject, auth_tokens.user_id → subject. FS JSON storage: user_id → subject on the three token kinds. GAE Datastore: same field renames. Existing data must be migrated or the affected stores reset — see docs/MIGRATION.md.
Out of scope (deferred to PR 2b):
core.GetUserIDFromContext/SetUserIDInContext/DefaultUserParamName="loggedInUserId"core.GetUserScopesFuncapiauth.PasswordGrantResponse.UserID/TokenInfo.UserID/GetUserIDFromAPIContexthttpauth.Middleware.GetLoggedInUserId/OneAuth.SetLoggedInUserID(public surface stays — internals flip in PR 2b)grpc.UserIDFromContext/DefaultMetadataKeyUserID="x-user-id"- Session cookie key
loggedInUserId(PR 2b invalidates active sessions)
See issue tracker for PR 2b.
Version 0.1.2 ¶
Client SDK — gRPC-shape ClientCredentials + RFC 8707 / RFC 9396 plumbing ¶
New AuthClient.ClientCredentials(req *ClientCredentialsRequest). Consolidated entry point for the client_credentials grant. Single request struct carries ClientID, ClientSecret, optional ClientAssertion (private_key_jwt), Scopes, Resources []string (RFC 8707 resource indicators — emitted as repeated resource form values per §2), and AuthorizationDetails []core.AuthorizationDetail (RFC 9396 — JSON-encoded into the authorization_details form value per §6.1). Extends the (ctx, *XRequest) → (*XResponse, error) convention adopted by apiauth/ (#175) and admin/ (#172) into the client SDK.
ClientCredentialsToken and ClientCredentialsTokenWithAssertion now wrap ClientCredentials — existing callers unaffected. New code should target the request struct directly to access Resources / AuthorizationDetails.
ClientCredentialsSource.Resources and .AuthorizationDetails restored as live fields, this time actually wired into the underlying token request. Resolves the dead-field gap that #211 flagged when removing the previous (non-functional) versions.
End-to-end coverage: TestRAR_ClientCredentials_SDKForm in the e2e suite exercises the full SDK → AS round-trip with both RFCs in play.
Follow-up to #211.
Version 0.1.1 ¶
Client SDK — private_key_jwt ergonomics ¶
ClientAssertionConfig.Audience (additive). New field on ClientAssertionConfig overrides the aud claim of a minted assertion. When empty, behaviour is unchanged (positional argument — typically the token endpoint URL — per OIDC Core §9). Set the field when targeting an RFC 7523bis-strict AS that requires aud to be the issuer identifier. MintClientAssertion and ClientCredentialsTokenWithAssertion both honour the override.
ClientCredentialsSource.ClientAssertion (additive). New *ClientAssertionConfig field on ClientCredentialsSource. When non-nil, the source routes through ClientCredentialsTokenWithAssertion instead of ClientCredentialsToken, applying the same caching, OnToken, and ProactiveRefresher machinery as the secret-based path. ClientSecret is ignored when ClientAssertion is set.
Cleanup — dead fields removed (breaking). Removed ClientCredentialsSource.Audience (RFC 8707 resource indicator) and ClientCredentialsSource.AuthorizationDetails (RFC 9396). Both fields were declared on the struct but never wired into the underlying token request, making them silent no-ops. No internal caller and no downstream consumer (mcpkit, goapplib, projects/*) set these fields. Proper RFC 8707 / RFC 9396 plumbing for client_credentials is tracked as a follow-up — the right home is the token-request layer, not the cached source.
Unblocks SEP-1046 conformance work in mcpkit issue 447 (umbrella 439).
See: issue 211.
Version 0.0.32 ¶
APIMiddleware Enhancements ¶
Query-parameter token fallback: Added configurable TokenQueryParam field to APIMiddleware. WebSocket clients often cannot set Authorization headers, so this enables GET /ws?token=<jwt> as a fallback. The Authorization header always takes precedence when both are present.
Custom claims in request context: Custom (non-standard) JWT claims are now stored in the request context during validation. Use the new GetCustomClaimsFromContext(ctx) helper to retrieve them downstream.
Internal changes: validateRequest and validateJWT now return custom claims alongside standard fields. All middleware methods (ValidateToken, RequireScopes, Optional) propagate custom claims into the request context.
Version 0.0.31 ¶
App Registration API & Reference Server ¶
AdminAuthinterface withAPIKeyAuthandNoAuthimplementations for protecting admin endpointsAppRegistrarHTTP handler providing full App CRUD: register, list, get, delete, and rotate secretMintResourceTokenhelper for issuing resource-scoped JWTs with app/subject claims- Config-driven reference server in
cmd/oneauth-server/with YAML config and environment variable substitution - Deployable to GAE, Docker Compose, and Kubernetes
- Integration tests (pytest) covering the full app registration lifecycle
Version 0.0.30 ¶
Redirect Mode for Password Reset Flows ¶
LocalAuth now supports redirect-based password reset for server-rendered apps. New fields ForgotPasswordURL and ResetPasswordURL control the behavior: when set, GET requests redirect to the app’s themed page, and POST requests redirect with query params (?sent=true, ?success=true, ?error=...). When empty (default), handlers behave as before (HTML form / JSON response).
Bug Fix: Multipart Form Parsing ¶
HandleForgotPassword and HandleResetPassword now correctly parse both application/x-www-form-urlencoded and multipart/form-data bodies. Previously, JavaScript new FormData(form) submissions returned 400 errors.
Version 0.0.29 ¶
Bug Fix: Password Reset for OAuth-Only Users ¶
NewUpdatePasswordFunc now creates a local channel on-demand when one doesn’t exist, enabling OAuth-only users to set a password via the standard reset flow. Previously these users received “local auth not configured” errors.
Version 0.2.0 ¶
API Authentication & Store Reorganization ¶
Major release adding API authentication (JWT access tokens, refresh tokens with rotation and theft detection, API keys, scopes) and new store backends.
New endpoints: /api/login, /api/logout, /api/logout-all, /api/keys (CRUD).
APIMiddleware: ValidateToken, RequireScopes, and Optional handlers for protecting API routes. Supports both JWT and API key authentication.
Store reorganization: Stores moved to stores/fs, stores/gorm, and stores/gae subdirectories. GORM provides full SQL database support; GAE provides Google Cloud Datastore support.
New store interfaces: RefreshTokenStore and APIKeyStore.
Breaking change: Import paths changed from github.com/panyam/oneauth/stores to github.com/panyam/oneauth/stores/{fs,gorm,gae}.
New dependencies: github.com/golang-jwt/jwt/v5, gorm.io/gorm (optional), cloud.google.com/go/datastore (optional).
Version 0.1.0 (Initial Release) ¶
Overview ¶
Initial release of OneAuth, a Go authentication library providing unified local and OAuth-based authentication with multi-method account linking.
Core Features ¶
- Three-layer model: Users, Identities, and Channels with global identity verification
- Local auth: Email/phone + password with bcrypt hashing, configurable validation
- OAuth integration: Google, GitHub, etc. with automatic identity unification across providers
- Email verification: Token-based flow with configurable expiry and extensible sender interface
- Password reset: Secure token-based flow with anti-enumeration (always returns success)
- Session management: Callback-based (
HandleUser) supporting cookies, JWTs, or custom schemes
Storage ¶
- File-based stores (FS): JSON file storage for Users, Identities, Channels, and Tokens. Suitable for development and small-scale use (<1000 users).
- Database-agnostic interfaces:
UserStore,IdentityStore,ChannelStore,TokenStorefor production implementations.
HTTP Endpoints ¶
/auth/login, /auth/signup, /auth/verify-email, /auth/forgot-password, /auth/reset-password. Accepts form-encoded and JSON bodies; returns JSON responses.
Helper Functions ¶
NewCreateUserFunc, NewCredentialsValidator, NewVerifyEmailFunc, NewUpdatePasswordFunc, DetectUsernameType, DefaultSignupValidator, GenerateSecureToken.
Known Limitations ¶
File-based stores not recommended at scale. No built-in rate limiting, CSRF protection, or session storage (application responsibility). Console email sender only.
Dependencies ¶
golang.org/x/crypto/bcrypt, golang.org/x/oauth2 (optional).