59 Commits

Author SHA1 Message Date
Wim Van Laer a4ecfb1c09 Merge branch 'main' into merge-main
# Conflicts:
#	README.md
#	example/client/app/app.go
#	example/server/exampleop/op.go
#	example/server/main.go
#	pkg/client/client.go
#	pkg/client/rp/relying_party.go
#	pkg/client/rp/relying_party_test.go
#	pkg/client/tokenexchange/tokenexchange.go
#	pkg/crypto/key_test.go
#	pkg/oidc/token.go
#	pkg/oidc/verifier.go
#	pkg/op/auth_request.go
#	pkg/op/device.go
#	pkg/op/server_http_routes_test.go
#	pkg/op/token.go
#	pkg/op/token_refresh.go
2025-11-28 11:19:02 +01:00
Tim Möhlmann c85da539c0 chore(go): add support for 1.25 (#798)
- Add Go 1.25 to the test matrix
- Oldest supported Go version is now 1.24, as required for
https://github.com/zitadel/oidc/pull/796
- Fix non-constant format string build errors

### Definition of Ready

- [x] I am happy with the code
- [x] Short description of the feature/issue is added in the pr
description
- [x] PR is linked to the corresponding user story
- [x] Acceptance criteria are met
- [x] All open todos and follow ups are defined in a new ticket and
justified
- [x] Deviations from the acceptance criteria and design are agreed with
the PO and documented.
- [x] No debug or dead code
- [x] My code has no repetitions
- [x] Critical parts are tested automatically
- [x] Where possible E2E tests are implemented
- [x] Documentation/examples are up-to-date
- [x] All non-functional requirements are met
- [x] Functionality of the acceptance criteria is checked manually on
the dev system.
2025-09-08 12:05:27 +03:00
Livio Spring 9efe061b2a chore: add limited availability notice to readme (#786)
### Definition of Ready

- [ ] I am happy with the code
- [ ] Short description of the feature/issue is added in the pr
description
- [ ] PR is linked to the corresponding user story
- [ ] Acceptance criteria are met
- [ ] All open todos and follow ups are defined in a new ticket and
justified
- [ ] Deviations from the acceptance criteria and design are agreed with
the PO and documented.
- [ ] No debug or dead code
- [ ] My code has no repetitions
- [ ] Critical parts are tested automatically
- [ ] Where possible E2E tests are implemented
- [ ] Documentation/examples are up-to-date
- [ ] All non-functional requirements are met
- [ ] Functionality of the acceptance criteria is checked manually on
the dev system.
2025-08-19 15:21:14 +02:00
Jan-Otto Kröpke 21e830e275 feat: exclude OTEL instrumentation via build tag (#770)
* feat: exclude OTEL instrumentation via build tag

* add readme
2025-07-16 11:29:59 +00:00
Iraq 2c64de821d chore: updating go to 1.24 (#726)
* chore: updating go to 1.24

* fixup! chore: updating go to 1.24

* fixup! fixup! chore: updating go to 1.24

* fix device test (drop read error)

* drop older go versions

* drop unrelated formatter changes

---------

Co-authored-by: Iraq Jaber <IraqJaber@gmail.com>
Co-authored-by: Tim Möhlmann <tim+github@zitadel.com>
2025-03-14 16:12:26 +01:00
Tim Möhlmann 1464268851 chore(deps): upgrade go to v1.23 (#681) 2024-11-15 07:26:03 +01:00
Livio Spring f1e4cb2245 feat(OP): add back channel logout support (#671)
* feat: add configuration support for back channel logout

* logout token

* indicate back channel logout support in discovery endpoint
2024-10-30 08:44:31 +00:00
lanseg 24869d2811 feat(example): Allow configuring some parameters with env variables (#663)
Co-authored-by: Andrey Rusakov <andrey.rusakov@camptocamp.com>
2024-10-21 20:59:28 +02:00
Tim Möhlmann 14e8529b68 chore(next): v4 module for development 2024-04-02 14:23:12 +03:00
Tim Möhlmann e3e48882df chore: upgrade to v3 guide (#463)
* chore: upgrade to v3 guide

first version with sed scripts.

* tidy up introduction info

* process feedback from @muir

* logging chapter

* server interface chapter

* update readme with v3 badges and link to update guide

* resolve comments
2024-03-05 13:09:14 +00:00
Tim Möhlmann 972b8981e5 feat: go 1.22 and slog migration (#557)
This change adds Go 1.22 as a build target and drops support for Go 1.20 and older. The golang.org/x/exp/slog import is migrated to log/slog.

Slog has been part of the Go standard library since Go 1.21. Therefore we are dropping support for older Go versions. This is in line of our support policy of "the latest two Go versions".
2024-02-28 10:44:14 +01:00
mffap ed21cdd4ce docs: update features client credential grant (#497)
Introduced with https://github.com/zitadel/oidc/pull/494
2023-12-06 11:51:24 +02:00
Tim Möhlmann d9487ef77d Merge branch 'next' into next-main 2023-10-12 16:07:49 +03:00
Tim Möhlmann 1683b319ae feat(op): add opentelemetry to token endpoint (#436)
* feat(op): add opentelemetry to token endpoint

* drop go 1.18, add 1.21, do not fail fast
2023-09-01 10:53:14 +02:00
Tim Möhlmann 0879c88399 feat: add slog logging (#432)
* feat(op): user slog for logging

integrate with golang.org/x/exp/slog for logging.
provide a middleware for request scoped logging.

BREAKING CHANGES:

1. OpenIDProvider and sub-interfaces get a Logger()
method to return the configured logger;
2. AuthRequestError now takes the complete Authorizer,
instead of only the encoder. So that it may use its Logger() method.
3. RequestError now takes a Logger as argument.

* use zitadel/logging

* finish op and testing
without middleware for now

* minimum go version 1.19

* update go mod

* log value testing only on go 1.20 or later

* finish the RP and example

* ping logging release
2023-08-29 14:07:45 +02:00
mffap 7997994be4 chore(docs): add oidc link to badge (#382) 2023-04-26 12:29:35 +03:00
Tim Möhlmann c8cf15e266 upgrade this module to v3 2023-03-20 13:38:21 +02:00
Tim Möhlmann 62caf5dafe chore: update features in readme
- rotated features table for better rendering
- add links to specifications in feature table
- remove redundant links from the resources section
- changed "Token Exhange" feature to full yes (PR #255)
- add "Device Authorization" with full yes (PR #285)
2023-03-16 18:44:02 +02:00
Tim Möhlmann 0476b5946e Merge branch 'next' into main-next
prepare the merge of next into main by resolving merge conflicts.
2023-03-15 16:26:32 +02:00
Tim Möhlmann dea8bc96ea refactor: use struct types for claim related types (#283)
* oidc: add regression tests for token claim json

this helps to verify that the same JSON is produced,
after these types are refactored.

* refactor: use struct types for claim related types

BREAKING CHANGE:
The following types are changed from interface to struct type:

- AccessTokenClaims
- IDTokenClaims
- IntrospectionResponse
- UserInfo and related types.

The following methods of OPStorage now take a pointer to a struct type,
instead of an interface:

- SetUserinfoFromScopes
- SetUserinfoFromToken
- SetIntrospectionFromToken

The following functions are now generic, so that type-safe extension
of Claims is now possible:

- op.VerifyIDTokenHint
- op.VerifyAccessToken
- rp.VerifyTokens
- rp.VerifyIDToken

- Changed UserInfoAddress to pointer in UserInfo and
IntrospectionResponse.
This was needed to make omitempty work correctly.
- Copy or merge maps in IntrospectionResponse and SetUserInfo

* op: add example for VerifyAccessToken

* fix: rp: wrong assignment in WithIssuedAtMaxAge

WithIssuedAtMaxAge assigned its value to v.maxAge, which was wrong.
This change fixes that by assiging the duration to v.maxAgeIAT.

* rp: add VerifyTokens example

* oidc: add standard references to:

- IDTokenClaims
- IntrospectionResponse
- UserInfo

* only count coverage for `./pkg/...`
2023-03-10 16:31:22 +02:00
Tim Möhlmann 815ced424c readme: update zitdal docs link
Fixes #286
2023-02-24 11:04:37 +01:00
Tim Möhlmann 03f71a67c2 readme: update example commands 2023-02-24 10:47:01 +01:00
Tim Möhlmann 1165d88c69 feat(op): dynamic issuer depending on request / host (#278)
* feat(op): dynamic issuer depending on request / host

BREAKING CHANGE: The OpenID Provider package is now able to handle multiple issuers with a single storage implementation. The issuer will be selected from the host of the request and passed into the context, where every function can read it from if necessary. This results in some fundamental changes:
 - `Configuration` interface:
   - `Issuer() string` has been changed to `IssuerFromRequest(r *http.Request) string`
   - `Insecure() bool` has been added
 - OpenIDProvider interface and dependants:
   - `Issuer` has been removed from Config struct
   - `NewOpenIDProvider` now takes an additional parameter `issuer` and returns a pointer to the public/default implementation and not an OpenIDProvider interface:
     `NewOpenIDProvider(ctx context.Context, config *Config, storage Storage, opOpts ...Option) (OpenIDProvider, error)` changed to `NewOpenIDProvider(ctx context.Context, issuer string, config *Config, storage Storage, opOpts ...Option) (*Provider, error)`
   - therefore the parameter type Option changed to the public type as well: `Option func(o *Provider) error`
   - `AuthCallbackURL(o OpenIDProvider) func(string) string` has been changed to `AuthCallbackURL(o OpenIDProvider) func(context.Context, string) string`
   - `IDTokenHintVerifier() IDTokenHintVerifier` (Authorizer, OpenIDProvider, SessionEnder interfaces), `AccessTokenVerifier() AccessTokenVerifier` (Introspector, OpenIDProvider, Revoker, UserinfoProvider interfaces) and `JWTProfileVerifier() JWTProfileVerifier` (IntrospectorJWTProfile, JWTAuthorizationGrantExchanger, OpenIDProvider, RevokerJWTProfile interfaces) now take a context.Context parameter `IDTokenHintVerifier(context.Context) IDTokenHintVerifier`, `AccessTokenVerifier(context.Context) AccessTokenVerifier` and `JWTProfileVerifier(context.Context) JWTProfileVerifier`
   - `OidcDevMode` (CAOS_OIDC_DEV) environment variable check has been removed, use `WithAllowInsecure()` Option
 - Signing: the signer is not kept in memory anymore, but created on request from the loaded key:
   - `Signer` interface and func `NewSigner` have been removed
   - `ReadySigner(s Signer) ProbesFn` has been removed
   - `CreateDiscoveryConfig(c Configuration, s Signer) *oidc.DiscoveryConfiguration` has been changed to `CreateDiscoveryConfig(r *http.Request, config Configuration, storage DiscoverStorage) *oidc.DiscoveryConfiguration`
   - `Storage` interface:
     - `GetSigningKey(context.Context, chan<- jose.SigningKey)` has been changed to `SigningKey(context.Context) (SigningKey, error)`
     - `KeySet(context.Context) ([]Key, error)` has been added
     - `GetKeySet(context.Context) (*jose.JSONWebKeySet, error)` has been changed to `KeySet(context.Context) ([]Key, error)`
   - `SigAlgorithms(s Signer) []string` has been changed to `SigAlgorithms(ctx context.Context, storage DiscoverStorage) []string`
   - KeyProvider interface: `GetKeySet(context.Context) (*jose.JSONWebKeySet, error)` has been changed to `KeySet(context.Context) ([]Key, error)`
   - `CreateIDToken`: the Signer parameter has been removed

* move example

* fix examples

* fix mocks

* update readme

* fix examples and update usage

* update go module version to v2

* build branch

* fix(module): rename caos to zitadel

* fix: add state in access token response (implicit flow)

* fix: encode auth response correctly (when using query in redirect uri)

* fix query param handling

* feat: add all optional claims of the introspection response

* fix: use default redirect uri when not passed

* fix: exchange cors library and add `X-Requested-With` to Access-Control-Request-Headers (#261)

* feat(op): add support for client credentials

* fix mocks and test

* feat: allow to specify token type of JWT Profile Grant

* document JWTProfileTokenStorage

* cleanup

* rp: fix integration test

test username needed to be suffixed by issuer domain

* chore(deps): bump golang.org/x/text from 0.5.0 to 0.6.0

Bumps [golang.org/x/text](https://github.com/golang/text) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* op: mock: cleanup commented code

* op: remove duplicate code

code duplication caused by merge conflict selections

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Livio Amstutz <livio.a@gmail.com>
Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
Co-authored-by: Stefan Benz <46600784+stebenz@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-09 17:10:22 +01:00
Tim Möhlmann a34d7a1630 chore: add go 1.20 support (#275) 2023-02-06 11:11:11 +01:00
Tim Möhlmann 3a6c3543e7 chore: add go 1.20 support (#274) 2023-02-06 10:35:50 +01:00
Tim Möhlmann df5a09f813 chore: switch from iouitil to io.ReadAll (#272)
removed a TODO: switch to io.ReadAll and drop go1.15 support
2023-02-06 08:29:25 +01:00
Livio Spring 1535ea4f6c chore(examples): improve logging and how to use (#266) 2023-01-25 06:22:12 +01:00
Michael Holtermann c0f3ef8a66 Add folders to Basic Overview 2022-11-24 15:30:54 +01:00
Florian Forster 356dd89ae4 chore: fix broken codecov default branch (#245)
* chore: fix broken codecov default branch

* update codecov badge
2022-11-21 17:41:56 +01:00
Anthony Quéré 0596d83b33 doc: fix zitadel doc uri in the README (#239) 2022-11-03 10:11:15 +00:00
Florian Forster 4ac692bfd8 chore: house cleaning of the caos name and update sec (#232)
* chore: house cleaning of the caos name and update sec

* some typos

* make fix non breakable

* Update SECURITY.md

Co-authored-by: Livio Spring <livio.a@gmail.com>

* Update SECURITY.md

Co-authored-by: Livio Spring <livio.a@gmail.com>

Co-authored-by: Livio Spring <livio.a@gmail.com>
2022-10-17 09:13:54 +02:00
Weny Xu 3a7b2e8eb5 docs(README.md): fix typos 2022-10-17 08:06:41 +02:00
Livio Spring 0e7949b1a0 chore: add go 1.19 to matrix build (#202)
* chore: add go 1.19 to matrix build

* try rc2

* use rc

* remove rc and update readme

* update ubuntu version
2022-08-08 15:02:36 +02:00
mffap 292b0cc9f9 chore: update website (#195) 2022-07-20 15:31:30 +02:00
David Sharnoff fb0c466839 chore: add doc links (#190) 2022-06-30 13:20:18 +02:00
Livio Amstutz ff124f87f5 docs(readme): update features and add contributors (#180) 2022-05-11 10:19:16 +02:00
Florian Forster 550f7877f2 fix: move to new org (#177)
* chore: move to new org

* chore: change import

* fix: update logging lib

Co-authored-by: Fabienne <fabienne.gerschwiler@gmail.com>
Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
2022-04-26 23:48:29 +02:00
Livio Amstutz 885fe0d45c docs(example): implement OpenID Provider (#165)
* chore(example): implement OpenID Provider

* jwt profile and fixes

* some comments

* remove old op example

* fix code flow example

* add service user and update readme

* fix password for example use

* ignore example and mock folders for code coverage

* Update example/server/internal/storage.go

Co-authored-by: Silvan <silvan.reusser@gmail.com>

* Update client.go

Co-authored-by: Silvan <silvan.reusser@gmail.com>
2022-04-21 17:54:00 +02:00
Livio Amstutz 0dd79cb6f9 chore(build): add go 1.18 to matrix build (#166)
* chore(build): add go 1.18 to matrix build

* add 1.18

* Update README.md

* Update release.yml
2022-03-22 07:26:00 +01:00
Rohinish f103b56e95 docs(readme): corrected terminology 2022-01-22 19:20:58 +01:00
Livio Amstutz 55ec7d9dd2 docs: remove implicit and hybrid flow from supported RP features in readme (#136)
* docs: remove implicit flow from supported features in readme

* docs: remove implicit flow from supported features in readme

Co-authored-by: Florian Forster <florian@caos.ch>

Co-authored-by: Florian Forster <florian@caos.ch>
2021-10-26 09:15:02 +02:00
jmillerv 292188ba30 docs: fix readme typos (#134) 2021-10-10 19:30:24 +00:00
陈杨文 ff2c164057 fix: improve example & fix userinfo marshal (#132)
* fix: example client should track state, call cli.CodeFlow need context

* fix: oidc userinfo can UnmarshalJSON with address

* rp Discover use client.Discover

* add instruction for example to README.md
2021-10-08 08:20:45 +02:00
Livio Amstutz 1bd04e9f36 Merge pull request #117 from caos/workflow
chore: start improving external contribution
2021-08-27 15:36:51 +02:00
Livio Amstutz 87061e0123 chore: add 1.17 to matrix build 2021-08-27 14:57:48 +02:00
Florian Forster 3a37300e7a docs: certification comment (#113) 2021-08-03 17:00:24 +02:00
Florian Forster a2583ad772 docs: improve wording (#103) 2021-06-14 15:59:51 +02:00
Livio Amstutz 8e884bdb9f feat: refresh token (#98)
add missing feature commit and readme update
2021-05-18 09:03:11 +02:00
Livio Amstutz 602592d5f3 chore(pipeline): add Go 1.16 to matrix build (#90)
* chore(pipeline): add 1.16 to matrix build

* chore(readme): add GO 1.16 to supported versions
2021-03-18 13:35:56 +01:00
Florian Forster f6863b95f3 docs(OAuth 2.0): JWT Profile (#57) 2020-09-21 07:03:22 +02:00