Commit Graph

75 Commits

Author SHA1 Message Date
Arthur Schiwon fae25fa4ab
fix signining in with IdPs other than 1
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-08-24 14:32:57 +02:00
Julius Härtl b91b85f417
Set proper relaystate url
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-04-08 07:45:59 +02:00
Arthur Schiwon 6548abb0f9 makes sloWebServerDecode IdP-sensitive as it should be
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-04-07 20:29:04 +00:00
Arthur Schiwon be6a8e97fe Move SAML configurations to a table of their own
- adds user_saml_configurations table and migrates existing configuration
- Controller methods are added since appconfig endpoints cannot be used
  anymore. THIS IS A BREAKING CHANGE.
- Frontend code is adjusted to use new endpoints.
- security-sloWebServerDecode was changed from global to provider specific
  setting. It being global seemed to be unintended. A migration path is yet
  missing.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-04-07 20:29:03 +00:00
John Molakvoæ 4510f70ff7
cs:fix
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2021-12-10 09:28:16 +01:00
Julius Härtl 763fa83e19
Use effective uid for autoprovisioning new users
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-10-21 13:13:01 +02:00
Lukas Reschke 05a0275b97 Actually replace $retrieveParametersFromServer parameter
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-05-05 13:25:54 +02:00
Lukas Reschke 8afcb434dc Allow setting of "retrieveParametersFromServer"
Some SAML servers require this type of decoding, otherwise the SLO request fails. Ideally the library would perform both verifications (https://github.com/onelogin/php-saml/issues/466), but it seems upstream doesn't want to perform this change.

Until we have considered a better solution for this, this adds a new checkbox that one can configure.

Ref https://github.com/nextcloud/user_saml/issues/403

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-05-04 17:28:58 +02:00
blizzz e37fee7f38
Merge pull request #508 from nextcloud/fix/noid/userids-not-sanitized
sanitize and test user id received from IdP, if original does not match
2021-03-01 14:09:38 +01:00
Lukas Reschke 10cf853b15 Add logging for SLO errors
To make debugging SLO errors easier, this adds logging for any
encountered error in that phase.

This is similar to the logging already done on the ACS handling.

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2021-02-15 19:08:31 +00:00
Arthur Schiwon b13a9983e2
adjust to recent merged changes
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-01-26 19:03:03 +01:00
Arthur Schiwon a7aabdd71f
introduces a single point of saml attribute interpretations
- solved code duplication on uid mapping attribute determiniation
- a single point for user id normalization
- slightly reduces logic in the Controller

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-01-26 14:32:19 +01:00
Arthur Schiwon 9ed277dc1f
sanitize and test user id received from IdP, if original does not match
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-01-26 14:31:04 +01:00
Roeland Jago Douma 7f7def4b7f
Allow customer directlogin text
Some people seem to want to have a custom direct login text. This allows
them to set it. For now only via occ. But maybe some day we also add a
GUI component to it.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2021-01-12 14:44:05 +01:00
Roeland Jago Douma 1c2be57e20
Merge pull request #468 from orandev/patch-1
Fix incorrect key name in "Login flow fix"
2020-11-24 15:25:44 +01:00
Arthur Schiwon 9bf08a698d
fix missing user_saml.Idp session value which SAMLSettings rely on
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-11-05 22:27:31 +01:00
orandev c318b9421f
Fix incorrect key name in "Login flow fix"
'name' key was put in flowData table, but 'token' key was retrieved from this table, thus triggering the following error:
Undefined index: token at /nextcloud/apps/user_saml/lib/Controller/SAMLController.php#306

Signed-off-by: orandev <63342732+orandev@users.noreply.github.com>
2020-10-09 12:20:10 +02:00
Julius Härtl 4184aa9fa8
Add checked user id to InvalidArgumentException
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-10-09 08:39:37 +02:00
Roeland Jago Douma 5c87778134
Fix login flow with SAML
Because of the strict samesite cookies SAML fails with the login flow.
Because the post that comes back is not transfering the proper cookies
to use the same session. Hence the token in use gets lost etc.

Now we store this all (encrypted) in a cookie. So that when we come back
we can restore the proper session.

FAQ:

* Is it elegant?
  Nope!
* Does it work?
  Yes!

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-10-05 15:16:38 +02:00
Roeland Jago Douma 160ad27474
Handle failing SLO
If the SLO throws an error we should catch it. This is so that we do not
show an error page. We should also still logout the current session.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-09-25 09:26:37 +02:00
Arthur Schiwon 238b578cf1
acs endpoint to always return a RedirectResponse
* the void statements end up in a useless blank page

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-09-08 17:01:15 +02:00
Roeland Jago Douma f5304f6757
Make work with posts and cookies again
Requires https://github.com/nextcloud/server/pull/21479 to fully work.
Basically don't save this info in the session (which is lax by default
starting with NC19 but also soon with new chromes and firefox). We now
save it is a cookie that is set to None. This is the best we can do I
think.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-07-10 10:01:16 +02:00
Clément OUDOT 8d6eb60128 Merge remote-tracking branch 'upstream/master' into fix-saml-single-logout 2020-03-05 19:39:12 +01:00
Frank Tröger ee459c687c
fixed login with chrome browser
- fix 'environment-variable' login problem with chrome browser
- problem: using nextcloud behind apache2 mod_auth_mellon, chrome browser gets too many redirects
- description: nc_sameSiteCookiestrict is not sent by chrome, because of the origin POST request by idp and the 3xx redirects on nextcloud side
2020-01-28 20:01:47 +01:00
Soisik Froger 2313df0e00 use NameId format, name qualifier and name SP qualifier in SAML logout request (fixed SP qualifier typo)
Signed-off-by: Clément OUDOT <clement.oudot@worteks.com>
2019-12-16 16:59:48 +01:00
Clément OUDOT 04fcb5387b use NameId format, name qualifier and name SP qualifier in SAML logout request
Signed-off-by: Clément OUDOT <clement.oudot@worteks.com>
2019-12-16 16:59:48 +01:00
Arthur Schiwon c839dc1e73
decode objectGUID to their ASCII representation if
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-09-19 14:07:06 +02:00
Frieder Schrempf 413c7a9239
Handle SLO logout requests from IdP via POST
Some IdPs send their SLO logout requests via POST. To handle
them we need to add an entry in the routing table.
Further, we need to hack around the issue, that php-saml only
handles GET by copying the request from $_POST to $_GET.

This solves #82.

Signed-off-by: Frieder Schrempf <frieder.schrempf@online.de>
2019-06-17 18:56:55 +02:00
Dylann Cordel f780006005
fix IDP-initiated Logout #334
Signed-off-by: Dylann Cordel <d.cordel@webu.coop>
2019-06-07 21:28:04 +02:00
Björn Schiessle 577f612267
Merge pull request #286 from nextcloud/fix-268
always create user in the SAML back-end and update the attributes
2019-01-24 14:58:11 +01:00
Arthur Schiwon ec593bce13
user might be already known, but was not mapped yet. init on first login.
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-01-22 13:38:56 +01:00
rakekniven 4e82b97055
Fixed typo.
Reported at Transifex.

Signed-off-by: Mark Ziegler <mark.ziegler@rakekniven.de>
2019-01-19 22:30:10 +01:00
Björn Schiessle 0b0bfe94a2
create user in the SAML back-end and update the attributes when
the user was found on another back-end during login

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-12-18 16:54:27 +01:00
Daniel Klaffenbach 624d1a23b9 Implement mapping of user's home directory
Signed-off-by: Daniel Klaffenbach <daniel.klaffenbach@hrz.tu-chemnitz.de>
2018-11-22 09:45:08 +01:00
Björn Schiessle 9790fbcb56
improve error messages in case SAML is not configured properly
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-11-20 17:34:46 +01:00
Björn Schiessle 69c0c5f479
log IDP parameters in debug mode
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-11-16 16:46:31 +01:00
Robin Appelman f20252a5f4 log provisioning errors during sso environment login
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-11-14 15:05:44 +01:00
Björn Schiessle fadb3a1e4a
add a combobox instead of buttons to select the login method if more then 4 different IDPs are configured
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-11-09 14:46:38 +01:00
Björn Schiessle 860ffb24ad
make global scale setup more robust
If this server acts as a global scale master and the user is not
a local admin of the server we just create the user and continue
no need to update additional attributes.
But for local users, e.g. the admins of the global scale master
we should complete the user setup with all attributes

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-10-24 14:06:27 +02:00
Roeland Jago Douma 140100b23e
Actually add error page
* The base route now has a function as well so it is not just some empty
route
* We now actually have an error page

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-10-11 11:56:55 +02:00
Björn Schiessle 425173365e
adjust Nextcloud app to php-saml 3.0
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-10-09 22:08:33 +02:00
Björn Schiessle b80b94e408
we need to store some basic user information, even in the global scale scenario
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-10-09 16:57:03 +02:00
Björn Schiessle 53fe18a99f
allow redirect to the logout if it comes from the same server
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-09-25 15:56:36 +02:00
Björn Schiessle 4f852af4ce
don't auto provision the user on a global scale setup
with global scale the authentication happens on the master node
and then the user is forward to the node they are located.
Therefore no user should be created on the master node after the
authentication at the idp was successful

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-09-25 15:51:22 +02:00
Jean-Baptiste PIN 3f3cd68ef4
added redirection to originalUrl when using SSO
Signed-off-by: Jean-Baptiste PIN <jeanbaptiste@idruide.com>
2018-08-17 16:14:19 +02:00
Jean-Baptiste 0828185832
Added copyright
Signed-off-by: Jean-Baptiste <jibet.pin@gmail.com>
2018-08-17 16:14:09 +02:00
Björn Schiessle 2ac9adaf79
add missing parameter to function call
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-08-13 17:06:54 +02:00
Björn Schiessle 73ae008f6c
fix documentation
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-08-03 18:31:14 +02:00
Björn Schiessle d055a0dafb
fix property name
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-08-03 12:43:20 +02:00
Björn Schiessle 2d62533eac
fix unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-08-03 12:43:20 +02:00