20 Commits

Author SHA1 Message Date
Oliver Günther 86daea4b45 Revert "[#67763] Remove omniauth-openid_connect-providers." 2025-11-05 08:19:33 +01:00
ba1ash 6b1c30d381 [#67763] Remove omniauth-openid_connect-providers. 2025-10-22 17:22:52 +02:00
Jan Sandbrink a5507ff639 Fix usage of acr_values and claims
Previously it was possible to configure them through the UI, but they
were not passed into configuration of the Omniauth provider at all.

Correct configuration also uncovered a bug in omniauth-openid-connect that
was fixed through an update of the gem.
2025-07-30 09:49:09 +02:00
ulferts 3a5b66cabb Merge remote-tracking branch 'origin/release/15.4' into dev 2025-03-19 15:47:41 +01:00
Jan Sandbrink f41175c7d0 Correctly handle when expires_in is a string
Azure/Entra ID seems to return stringly typed
expiry dates under certain conditions. We'll now
also handle properly readable numeric strings.

Missing expiration times or non-numeric strings,
such as "banana" will be treated as not knowing
the expiration time.
2025-03-19 08:52:10 +01:00
Jan Sandbrink ecbf6bdda9 Add magic comment for frozen string literals to OIDC module
Some files were missing the corresponding comment before.
This change was effectively achieved through:

    rubocop -A --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment,Style/RedundantFreeze modules/openid_connect
2025-03-18 14:46:00 +01:00
Jan Sandbrink 21632c4938 Add missing copyright headers to OIDC module 2025-03-18 14:46:00 +01:00
Jan Sandbrink 6e000374e5 Do not call create service when access token is missing
Other parameters stored in the session are kind of optional,
but without the access token we can't create a user token.

The most popular case for a missing access token should be
that the login happened through a non-OIDC provider.
2025-03-13 16:35:29 +01:00
Jan Sandbrink c8be09420a Ensure to only store tokens for OIDC logins
The hook we are using is firing for all kinds of omniauth
logins. By ensuring that we have a matching OpenIDConnect provider,
we know that we are currently performing an OIDC login, which is
the only case where we want to try storing OIDC tokens.
2025-03-13 09:33:00 +01:00
Jan Sandbrink cdc304faf4 Change the way user tokens are stored
This commit provides an alternative implementation
for storing tokens compared to the parent commit.

The idea is that we will not only need to store access
and refresh tokens obtained via Omniauth, but also the ones
to access third party services that will most likely be obtained
through OAuth 2.0 Token Exchange. This structure allows to store
all of these tokens in the same data model, while keeping the
implementation separated from the back-channel logout logic.
2025-01-13 16:13:34 +01:00
Jan Sandbrink 12da6c6b12 Save OIDC tokens to OpenProject database.
Storing tokens in the database to have them available for
requests to third parties (e.g. Nextcloud) later.

The OIDC session is now marked as optional, since the
session link is also used to store access and refresh tokens
associated with the session. Those tokens might be present,
even if the session id (which belongs to the optional
OIDC Back-Channel Logout specification) is missing.
2025-01-13 16:13:34 +01:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
ulferts 3b2121f733 Revert "Merge remote-tracking branch 'origin/release/13.4' into dev"
This reverts commit 40b2bbeb09, reversing
changes made to b4c6cb17cc.
2024-03-21 11:31:17 +01:00
Ivan Kuchin 7787e457a3 Revert "Merge branch 'dev' into release/13.4"
This reverts commit a901541269, reversing
changes made to e573ca00b7.
2024-03-20 20:19:08 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01:00
Christophe Bliard c795874f7f Update copyright year for 2024
command used: `rg -l 'Copyright \(C\) 2012-202\d the OpenProject' | xargs -n 100 sed -i -r 's/Copyright \(C\) 2012-202. the OpenProject/Copyright (C) 2012-2024 the OpenProject/'`
2024-01-02 16:23:54 +01:00
Christophe Bliard 4c2a9d0aa8 Enable RSpec zero monkey patching mode
The plan for RSpec 4.0 is to disable monkey patching.

See https://github.com/rspec/rspec-core/blob/main/features/configuration/zero_monkey_patching_mode.feature for details.
2023-05-31 19:22:29 +02:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Oliver Günther a459633111 Call authorized hook in service 2022-11-23 11:57:41 +01:00
Oliver Günther 15d21ecbac Add spec for session mapper 2022-11-23 10:52:32 +01:00