141 Commits

Author SHA1 Message Date
Jan Sandbrink 2cba22d34e Fix direct login for unauthenticated requests to OAuth authorize
This triggered a "cross reaction" of sorts.

bbd4cad40 tried to fix a redirect loop by checking for the presence of
content in `flash` (assuming that this meant the presence of a text message
to be shown to the user).

0fa8b4a77 used the flash storage to forward CSP extensions so they are usable
for exactly one follow-up request. While this is an allowed usage of `flash`,
it was sufficiently far away from what it's usually used for that it threw over
expectations of the former change and consequently led to breaking the direct login
workflow.

The specs were not working as intended, because the settings-update of with_config was
effectively undone by also using with_settings in the same spec.
2026-05-04 15:42:17 +02:00
Oliver Günther 468fa6de78 Adapt tests now that we use link_translate 2026-03-20 09:49:11 +01:00
Oliver Günther 4d731dcab6 Replace raw and explicit html_safe calls 2026-03-20 09:49:10 +01:00
Henriette Darge 313127fb5c Fix tests
Update config/locales/en.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update app/views/my/account.html.erb

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update app/forms/my/account_form.rb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

Update app/forms/my/account_form.rb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

Update app/forms/my/account_form.rb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

Apply suggestion from @myabc

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
2025-11-26 16:29:25 +01:00
Alexander Brandon Coles 4e73d6c557 Fix wording (docs, UI): change "expiry" to "expiration" 2025-11-11 20:29:03 +00:00
Jan Sandbrink ea71a616b9 Test forgot password flow stricter
Previously we tested nothing in the email, not even the subject.
This means a broken implementation that always would send "can't change password"
would not have been discovered.

The new test checks the subject (comparable to the other test cases in the same file)
and also does not simply assume that the mail will contain the correct link, but rather
uses the link from the mail.
2025-11-10 14:00:27 +01:00
Jan Sandbrink e400fd7e4c Allow changing password if it exists
Previously we'd be hiding the "change password" dialog on the
basis of an external authentication method existing. However, that's
not enough, because (at least with user remapping enabled) it's possible
that a user that logged in via password once, gained the ability to login
through SSO afterwards. Such a user then can use both mean to authenticate,
thus they also need to be able to change a potentially compromised password.

Much more work is needed here: Users need to be aware that their password still
works, they need to be able to delete a password if they only want to use SSO and
maybe there's also a use case for deleting an SSO association and going back to
password-based logins. However, all of these things require more UI changes and
some proper product development first.

This change is a first step to improve the situation.
2025-11-10 14:00:02 +01:00
Henriette Darge 5c249403b0 Primerizse login form partially 2025-11-03 11:12:07 +01:00
Dombi Attila 6e9e0eb1e2 Add specs with forced password change having invalid user custom fields 2025-10-14 12:01:58 +02:00
Oliver Günther c3aefec8a4 Render direct login button only when not logged in 2025-08-13 10:32:09 +02:00
Henriette Darge 8f60babb96 Fix some more tests && render the revit add-in entry normally via the menu initializer and only toggle the visibility via JS 2025-07-24 11:30:07 +02:00
Henriette Darge a877bf802d Provide correct aria attributes for quick add menu and fix some more tests 2025-07-23 11:46:35 +02:00
ulferts 05ecbe13ed robustness on calling account/consent outside of login process 2025-07-08 12:30:40 +02:00
Pavel Balashou 2db9ef305c [#63912] Support multiple authentication provider user links
https://community.openproject.org/work_packages/63912
2025-06-03 10:13:00 +02:00
Jan Sandbrink 0b87e7543f Freeze string literals in specs
Rolling out frozen string literals further by freezing all
string literals in core specs.
2025-05-05 09:29:55 +02:00
Jan Sandbrink 5792f3665b Add authentication_provider field to user factory
This is intended to be a more natural and readable way of manipulating the
identity_url of a user. It also means that if we ever decide to change
the way how the identity_url is built or how providers are attached to
a user, it should be easier to switch the majority of tests relying on it
over to the new schema.
2025-04-25 09:15:17 +02:00
Oliver Günther e3333a96f4 Add my page menu to global and redirect to root
https://community.openproject.org/work_packages/61881
2025-02-28 12:05:03 +01:00
Jan Sandbrink 3708fa4513 Expose User#authentication_provider as AR class
Previously we only got the slug name of the provider
as a string, which doesn't allow to further use the provider.

Converting it back into its AR representation allows to call
further methods on it, e.g. checking support for certain capabilities.
2025-01-20 14:09:00 +01:00
Oliver Günther b214c61315 Reset some specs 2025-01-14 13:23:57 +01:00
Oliver Günther f791d33b72 Replace specs 2025-01-14 10:20:35 +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
Oliver Günther df2ec4e941 wait for network_idle on logout_spec 2024-10-18 09:52:34 +02:00
Oliver Günther 6eb4782287 Wait for idle between login requests 2024-10-11 08:43:01 +02:00
Oliver Günther cd2d0f0e1a Remove primerized_flash prefix in methods 2024-09-30 21:39:36 +02:00
Oliver Günther 9cc3d98391 Replace expect_primerized_error -> expect_primerized_flash 2024-09-30 21:39:00 +02:00
Oliver Günther 1cf49e2c9f Adapt specs 2024-09-30 20:37:00 +02:00
Oliver Günther 982ce8d25f Fix failure message 2024-09-20 10:24:01 +02:00
Oliver Günther 9cff3772f9 Fix stubbed controller 2024-09-20 10:24:01 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Ivan Kuchin 0b87ed9b6a remove newlines from context descriptions 2024-07-29 19:27:17 +02:00
Oliver Günther c7286fb91f Set default host at all times
This results in us having to use a bit more helpers around request and feature specs
to ensure that the configured host name also matches the requested one.
2024-07-08 16:11:09 +02:00
Jens Ulferts 5a176ba9f3 Merge pull request #15733 from opf/code-maintenance/55192-require-authorize-by-default-for-controller-actions
[#55192] require authorize by default for controller actions
2024-06-11 11:31:06 +02:00
ulferts 088329d508 attempt to focus on explicitly allowing no_authorization_required! 2024-06-10 22:42:58 +02:00
Markus Kahl c7edd71b73 we have to use with_config (either that or with_settings) for both options as with_settings interferes with with_config 2024-06-06 09:02:22 +01: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
Pavel Balashou 0054a8673a Fix tests. 2024-02-13 22:07:39 +01:00
Oliver Günther 692c730195 Ensure we always look in LDAP for the user even if not onthefly 2024-02-06 16:05:59 +01:00
Christophe Bliard 8fa8584538 Run rubocop --autocorrect on all files
Only the safe cops have run. rubocop version is 1.59.0.
2024-01-05 15:27:09 +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
Oliver Günther 1fb14d119c Only set the omniauth back_url during direct login
Otherwise, users will be redirected to weird places like login or account/lost_password
2023-12-07 16:36:26 +01:00
Oliver Günther f88bfaade1 Rewrite consent without JS 2023-11-22 16:36:07 +01:00
Oliver Günther 885836184a Rework autologin cookie to not be unique 2023-11-22 16:36:07 +01:00
Oliver Günther d60120f1fb Adapt specs now that login_required defaults to true 2023-11-08 11:30:58 +01:00
Oliver Günther 1a4bc24480 Inform users about external password change
https://community.openproject.org/work_packages/36011
2023-08-17 08:20:24 +02:00
Oliver Günther e32d2d0058 Remove AuthSource base namespace, model 2023-07-27 08:16:43 +02:00
bsatarnejad 85411f20c7 change tests due to replacing .flash with .op-toast 2023-07-18 16:47:45 +02:00
Christophe Bliard 52303a1fe9 [48451] Include default language in valid languages
https://community.openproject.org/wp/48451
2023-06-15 11:17:34 +02:00
Christophe Bliard 914272c6cf Only allow available languages for Setting.default_language
- Store the language information everywhere as string instead of symbol.
- Remove pt-BR from default available_languages as pt is already there.
2023-06-06 11:46:24 +02:00