Commit graph

72 commits

Author SHA1 Message Date
Côme Chilliet
360e7ffcca Always catch OCP versions of authentication exceptions
And always throw OC versions for BC

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-01-11 18:00:59 +00:00
Joas Schilling
aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +01:00
Julien Veyssier
d56950a6c9
adjust phpdoc types in OauthApiController
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-10-05 14:24:03 +02:00
Julien Veyssier
d2bc483adf
adjust oauth app
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-10-05 14:24:02 +02:00
Julien Veyssier
32f984c520
adjust oauth tests
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-10-05 14:24:02 +02:00
Julien Veyssier
c6da99474e
rename oauth2_access_token's created_at to code_created_at
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-10-05 14:24:02 +02:00
Julien Veyssier
e944980eb6
add db index on oauth2_access_tokens's (token_count, created_at)
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-10-05 14:24:02 +02:00
Julien Veyssier
779e1d51ac
delete oauth access token when receiving a code that has expired
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-10-05 14:24:02 +02:00
Julien Veyssier
1ab45bad5d
refuse oauth authorization code if a token has already been delivered (active token)
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-10-05 14:24:02 +02:00
Julien Veyssier
7bba410997
cleanup access tokens that are still in authorization state and that have expired
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-10-05 14:24:02 +02:00
Julien Veyssier
2995b0948f
add tests for oauth2 authorization code expiration
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-10-05 14:24:02 +02:00
Julien Veyssier
807f173dec
make oauth2 authorization code expire after 10 minutes
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-10-05 14:24:02 +02:00
Joas Schilling
25309bcb45
techdebt(DI): Use public IThrottler interface which exists since Nextcloud 25
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-08-28 15:50:45 +02:00
jld3103
1c19c567fe
oauth2: Add OpenAPI spec
Signed-off-by: jld3103 <jld3103yt@gmail.com>
2023-07-12 07:32:30 +02:00
Julien Veyssier
629adc318f add bruteforce protection in OauthApiController
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-06-19 11:18:06 +02:00
Julien Veyssier
578bf8cc0b add extra migration that sets the secret column length in case the previous step has run when it was setting it to 256
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-06-14 17:21:38 +02:00
Julien Veyssier
24e517c5b3 make oauth2 client secret column larger
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-06-14 17:21:38 +02:00
Julien Veyssier
18c742a901
encrypt oauth2 client secrets
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
2023-06-07 11:36:08 +02:00
Artur Neumann
f634badf12
public interface to invalidate tokens of user
Signed-off-by: Artur Neumann <artur@jankaritech.com>
2023-03-14 17:13:29 +01:00
Artur Neumann
21be557e2a
invalidate existing tokens when deleting an oauth client
Signed-off-by: Artur Neumann <artur@jankaritech.com>
2023-03-14 17:13:23 +01:00
luz paz
9d26671f05 Fix typos in apps/ subdirectory
Found via `codespell -q 3 -S l10n,./apps/files_external/3rdparty -L adn,ba,boxs,keypair,jus,optionel,ressource,tabel ./apps/`

Signed-off-by: luz paz <luzpaz@github.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-09-05 12:59:54 +00:00
Carl Schwan
53db418ee9 Cleanup oauth2 admin settings
- Use more vue components
- Add link to doc

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-07-14 12:16:13 +02:00
Daniel Kesselberg
11cacb52d4
Use property name for addType
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2022-05-12 21:12:46 +02:00
Louis Chemineau
c5722869be Add oauth2_clients migration for Owncloud
Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-03-24 18:08:43 +01:00
Joas Schilling
c6ae53096c
More test fixing
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-12-01 22:17:19 +01:00
J0WI
3b656446af Introduce ISecureRandom::CHAR_ALPHANUMERIC
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
2021-07-08 15:11:31 +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
99f2fa73d1
Fix usage of rename executeUpdate
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-05-05 10:35:25 +02:00
Roeland Jago Douma
c2f7c417b2 Add psalm annotation to the DB handlers of OAuth2
* Psalm annotations
* To new executeUpdate

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-03-11 14:33:15 +01:00
Christoph Wurst
cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +02:00
Christoph Wurst
28f8eb5dba
Add visibility to all constants
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:54:27 +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
44577e4345
Remove trailing and in between spaces
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 16:07:47 +02:00
Christoph Wurst
1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +02:00
Daniel Kesselberg
509af24bc9
Fix invalid instantiation of TemplateResponse if client not found
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-03-15 11:55:07 +01: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
68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +01:00
Roeland Jago Douma
9e2bb5ef36 Move oauth admin settings to initialstate
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
2019-09-28 13:30:34 +00:00
Roeland Jago Douma
50862aadfd
Move OAuth down in admin security settings
For #16076

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-06-28 11:43:23 +02:00
Roeland Jago Douma
21d542f953
Use the proper names when setting entity types
Else this does 💥

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-04-18 21:10:52 +02:00
Roeland Jago Douma
eb407565b0
OAuth2 client identifier must be unique
Fixes #12981

This is highly unlikely to happen. But better to enforce it on the DB
level as well!

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-01-07 13:51:59 +01:00
Roeland Jago Douma
d7223ebf4d
OAuth2: Move to migrations
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-12-10 13:23:58 +01:00
Roeland Jago Douma
b9ac258870
Strict controllers
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-12-07 13:43:22 +01:00
Roeland Jago Douma
a478945767
Strict repair step
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-12-07 13:40:43 +01:00
Roeland Jago Douma
e22645136c
Strict Exceptions
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-12-07 13:39:51 +01:00
Roeland Jago Douma
a670a9e443
Move OAuth2 db code to QBMapper and make it strict
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-12-07 09:13:16 +01:00
Roeland Jago Douma
1e6711305a
Fail gracefull if an unkown oauth2 client tries to authenticate
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-12-06 21:14:34 +01:00
Roeland Jago Douma
674930da7f
Move ExpiredTokenException to the correct namespace
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-10-30 19:30:45 +01:00
Roeland Jago Douma
75456b057d
Reset bruteforce on token refresh OAuth
When using atoken obtained via OAuth the token expires. Resulting in
brute force attempts hitting the requesting IP.

This resets the brute force attempts for that UID on a valid refresh of
the token.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-10-30 11:21:27 +01:00
Patrik Kernstock
8f9fa9ee13 Remove filter_var flags due to PHP 7.3 deprecation, fixes #10894
Signed-off-by: Patrik Kernstock <info@pkern.at>
2018-09-04 00:58:44 +02:00