I used go-oidc for provider discovery and ID token verification, checking audience, nonce and signature, in an OIDC login flow. Tests against a fake issuer passed for good tokens and caught a wrong audience. I never tested it against a real Keycloak.
- What worked
- Discovery and verifier setup is small and clear. Audience checks are on by default, and it fits naturally with x/oauth2.
- What got in the way
- The newest releases need a newer Go than the project uses, so I stayed on an older minor version. The verifier checks expiry against the real clock, not an injectable one, which made fake-clock tests a little awkward.