Commit Graph

31 Commits

Author SHA1 Message Date
David Christofas
e96819bce8 rewrite the auth middleware
The old approach of the authentication middlewares had the problem that when an authenticator could not authenticate a request it would still send it to the next handler, in case that the next one can authenticate it. But if no authenticator could successfully authenticate the request, it would still be handled, which leads to unauthorized access.
2022-08-12 10:47:43 +02:00
Willy Kloucek
94646c8060 add middleware to rewrite the /.well-known/openid-configuration endpoint for external idps 2022-08-05 14:12:01 +02:00
Willy Kloucek
58ccdaca08 improve PROXY_USER_CS3_CLAIM description 2022-08-05 10:47:51 +02:00
Ralf Haferkamp
6e848c7254 Use mutex for lazy init function
To avoid possible threading issues
2022-08-03 12:00:31 +02:00
Ralf Haferkamp
74d9d0f3e0 Apply suggestions from code review
Co-authored-by: Martin <github@diemattels.at>
2022-08-03 12:00:31 +02:00
Ralf Haferkamp
8229567213 Allow to configure the JWKS refresh settings
This exposes a couple for knobs for the jwks keyfunc module to adjust
timeout and refresh intervals.
2022-08-03 12:00:31 +02:00
Ralf Haferkamp
eb94530433 Add option to configure access token verification
Allow to switch jwt access token verification and off. Many (most?) IDP
provide JWT encoded access tokens. If ocis is configure to assume jwt
access tokens (access_token_verify_method==jwt) we now properly verify
the tokens signature and a set of standard claims ("exp", "iat" and nbf"
by way of the jwt module's standard verification and "iss" explicitliy).

This change also allows for introduction of other access token verification
mechanism in the future (e.g. through introspection (RFC7662).
2022-08-03 12:00:31 +02:00
Ralf Haferkamp
454cea8a1c Try to verify access_token as JWT and extract expiry
We try to parse the access token as a JWT now. Verifying the signature
using the keys downloaded from the jwks_uri of the IDP. Currently we
only use it to extract the expiry information from the JWT. This could
be reworked to extract other claims from the token for authorization
purposes.

Fixes: #3841
2022-08-03 12:00:31 +02:00
Ralf Haferkamp
0b055ca621 Remove obsolete comment
Token/Userinfo caching is already present since a while
2022-08-03 12:00:31 +02:00
Willy Kloucek
8312803c16 improve error log for "could not get user by claim" error 2022-07-19 13:58:39 +02:00
Willy Kloucek
e0523796d9 Merge pull request #4204 from rhafer/cleanup
Remove unused BindEnv code
2022-07-15 07:14:06 +02:00
Ralf Haferkamp
946f3e8feb Remove unused BindEnv code
We dropped this in favour of envdecode a while ago.
2022-07-14 16:34:25 +02:00
Ralf Haferkamp
0f257af6e4 Align default login attribute across services
Up to now the builtin lico was using the "username" as the login
attribute, while the proxy (and to some extend the auth-basic) service
tried to uniquely identify users by mail address. This aligns the
default configuration of the services to use the username everywhere.

Fixes: #4039
2022-07-14 14:21:34 +02:00
Martin
d2ec1187bc Apply suggestions from code review 2022-07-08 16:03:17 +02:00
Willy Kloucek
02774a5378 add missing config descriptions 2022-07-08 15:32:26 +02:00
Phil Davis
af1a29d79f Merge pull request #4116 from owncloud/description_text_fixes
Env variable text fixes
2022-07-07 20:30:55 +05:45
Ralf Haferkamp
db634ae062 Remove non-working access_token parsing code
The removed code was broken is serveral ways:
- The key use for verification was always empty
- Using a static key for access_token verification is incompatible
  with key rotation
- The type assertion (which was never hit anyways) to convert
  the return MapClaims to StandardClaims can't really work
So in the end we were always using the default ttl for caching
the userinfo.
2022-07-07 16:18:10 +02:00
Ralf Haferkamp
bd4150ab01 Remove reduntant addtion of claims to context 2022-07-07 16:18:10 +02:00
Phil Davis
0dea5138fe More typo fixes 2022-07-07 19:53:28 +05:45
mmattel
246377b35b Env variable text fixes 2022-07-07 19:53:27 +05:45
André Duffeck
4f042aa071 Wire up the search service at the old webdav endpoint 2022-07-06 15:58:26 +02:00
Jörn Friedrich Dreyer
2e640424cf Merge pull request #4076 from aduffeck/enabled-machine-auth-in-ocdav
[full-ci] Enable machine auth in ocdav
2022-07-05 18:14:41 +00:00
Ralf Haferkamp
4a09d8a948 Remove redundant setting of cli.HelpFlag
The help flag is configured automatically by default already. We don't
need to redo that for every single service.

This also addresses one of the finding of "go race" (#4088)
2022-07-05 14:59:06 +02:00
André Duffeck
c2b163afe6 Improve description of the machine auth api key config options 2022-07-05 11:05:33 +02:00
David Christofas
a9b66d4189 Merge pull request #4093 from wkloucek/improve-startup-errors
improve startup error logging
2022-07-05 10:56:36 +02:00
Willy Kloucek
f02591b5c3 improve startup error logging 2022-07-05 10:12:46 +02:00
Willy Kloucek
627c79dea1 mask sensitive values in /config proxy debug server endpoint 2022-07-04 14:22:44 +02:00
Willy Kloucek
4d60867cd6 improve *_HTTP_ROOT descriptions 2022-06-29 09:44:12 +02:00
Willy Kloucek
8f3b0c50cd Merge branch 'master' into config-doc-descriptions 2022-06-28 13:03:19 +02:00
Christian Richter
f8f1320501 refactor extensions -> services
Signed-off-by: Christian Richter <crichter@owncloud.com>
2022-06-27 14:05:36 +02:00
Christian Richter
78064e6bab rename folder extensions -> services
Signed-off-by: Christian Richter <crichter@owncloud.com>
2022-06-27 14:05:36 +02:00