Commit Graph

31 Commits

Author SHA1 Message Date
Andy Scherzinger
e07a190641
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-27 14:53:40 +02:00
Christoph Wurst
22dc27810e
fix(auth): Keep redirect URL during 2FA setup and challenge
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2024-04-19 10:24:26 +02:00
Alexander Piskun
26d343d33a
AppAPI: allowed to bypass Two-Factor
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
2023-12-28 20:59:02 +03:00
Faraz Samapoor
e98cf3c374 Uses PHP8's constructor property promotion.
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
2023-06-23 23:03:56 +03:30
Côme Chilliet
f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +01:00
Christoph Wurst
df908c728a
Enable strict types for the 2FA middleware
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-12-16 13:58:25 +01:00
Christoph Wurst
74b1bf1d1c
Fix setting up 2FA when no providers are set up but backup codes
2FA set up is allowed when only backup codes are set up but no other
provider and no provider is failing.

This patch syncs up the login controller check with the challenge
controller check 10 lines above.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-12-10 11:35:36 +01:00
Christoph Wurst
c8caba265f
Explicitly allow some routes without 2FA
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-11-17 18:42:21 +01:00
Joas Schilling
3710eca104
Allow "TwoFactor Nextcloud Notifications" to pull the state of the 2FA again
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-10-04 11:26:08 +02:00
Lukas Reschke
7c1038bfb3
Remove 2FA exemption from PublicPage annotation
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-09-06 08:30:54 +00:00
Christoph Wurst
2fca843cc0
Fix setting up 2FA providers when 2FA is enforced and bc are generated
When a user has backup codes generated and got their 2FA enforced then
they should be able to set up TOTP and similar providers during the
login.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-07-30 18:29:23 +02:00
Lukas Reschke
04fa36d411 Improve provider check
Check if there is a provider missing.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-07-21 09:58:17 +02:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +02:00
Christoph Wurst
caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +02:00
Christoph Wurst
14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 10:35:09 +02:00
Christoph Wurst
5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Roeland Jago Douma
2cf068463f
Harden middleware check
These annotations will allow for extra checks. And thus make it harder
to break things.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-10-25 15:44:37 +02:00
Roeland Jago Douma
579162d7b9
Allow 2FA to be setup on first login
Once 2FA is enforced for a user and they have no 2FA setup yet this will
now prompt them with a setup screen. Given that providers are enabled
that allow setup then.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-05-17 10:11:53 +02:00
Roeland Jago Douma
8c77882794
No need to check 2fa state on apptoken logins
If you login with an apptoken there is no need to check 2FA state as
this does not apply to apptokens. Not checking saves us a query on each
request made from a client.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-02-20 17:40:40 +01:00
Morris Jobke
0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01:00
Lukas Reschke
f93a82b8b0
Remove explicit type hints for Controller
This is public API and breaks the middlewares of existing apps. Since this also requires maintaining two different code paths for 12 and 13 I'm at the moment voting for reverting this change.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-08-01 17:32:03 +02:00
Roeland Jago Douma
3548603a88
Fix middleware implementations signatures
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-07-31 16:54:19 +02:00
Joas Schilling
72c1b24844
Check whether the $_SERVER['REQUEST_*'] vars exist before using them
Signed-off-by: Joas Schilling <coding@schilljs.com>
2017-05-15 14:33:27 +02:00
Christoph Wurst
6af2efb679
prevent infinite redirect loops if the there is no 2fa provider to pass
This fixes infinite loops that are caused whenever a user is about to solve a 2FA
challenge, but the provider app is disabled at the same time. Since the session
value usually indicates that the challenge needs to be solved before we grant access
we have to remove that value instead in this special case.
2016-08-24 10:49:23 +02:00
Roeland Jago Douma
33f1532079
Throw exception if you don't handle it 2016-08-12 14:04:23 +02:00
Joas Schilling
ba87db3fcc
Fix others 2016-07-21 18:13:57 +02:00
Joas Schilling
3e3b326c85
Allow to cancel 2FA after login 2016-06-07 18:17:29 +02:00
Christoph Wurst
5e71d23ded
remember redirect_url when solving the 2FA challenge 2016-06-01 14:43:47 +02:00
Lukas Reschke
aba539703c
Update license headers 2016-05-26 19:57:24 +02:00
Christoph Wurst
847bbc51b6
add OCC command to enable/disable 2FA for a user 2016-05-23 11:21:13 +02:00
Christoph Wurst
dfb4d426c2
Add two factor auth to core 2016-05-23 11:21:10 +02:00