summaryrefslogtreecommitdiffstats
path: root/core/Controller/ClientFlowLoginController.php
Commit message (Collapse)AuthorAgeFilesLines
* Update license headersChristoph Wurst2019-12-051-2/+5
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Check getRedirectUri() for queriesRussellAult2019-11-131-3/+11
| | | | | | | | Resolves Issue #17885 Check getRedirectUri() for queries, and add a '&' instead of a '?' to $redirectUri if it already has them; otherwise, $redirectUri might end up with two '?'. Signed-off-by: RussellAult <russellault@users.noreply.github.com>
* fix oauth client redirectSergej Nikolaev2019-10-041-2/+10
| | | | Signed-off-by: Sergej Nikolaev <kinolaev@gmail.com>
* Fix login flow form actionsRoeland Jago Douma2019-08-111-2/+14
| | | | | | | | So fun fact. Chrome considers a redirect after submitting a form part of the form actions. Since we redirect to a new protocol (nc://login/). Causing the form submission to work but the redirect failing hard. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Emit event if app password createdDaniel Kesselberg2019-02-181-28/+9
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Publish activity for app token created by client login flowDaniel Kesselberg2019-02-171-1/+30
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Add StandaloneTemplateResponseRoeland Jago Douma2019-02-061-8/+8
| | | | | | | This can be used by pages that do not have the full Nextcloud UI. So notifications etc do not load there. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix template paramterRoeland Jago Douma2019-01-181-1/+1
| | | | | | Else we get shown an error page instead of the correct 403. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix loginflow with apptoken enter on iOSRoeland Jago Douma2019-01-041-0/+12
| | | | | | | It seems iOS doesn't like us to change the location. So now we submit it to the server that geneartes the redirect. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix SAML Client login flow on Apple devicesRoeland Jago Douma2018-12-171-0/+1
| | | | | | | | | | | Because the redirect from the SAML/SSO endpoint is a POST the lax/strict cookies are not properly send. Note that it is not strictly requried on this endpoint as we do not need the remember me data. Only the real session info is enough. The endpoint is also already protected by a state token. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Remove redirect pageJohn Molakvoæ (skjnldsv)2018-11-291-28/+0
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Use the proper server for the apptoken flow loginRoeland Jago Douma2018-11-011-21/+23
| | | | | | | | | | | | | If a user can't authenticate normally (because they have 2FA that is not available on their devices for example). The redirect that is generated should be of the proper format. This means 1. Include the protocol 2. Include the possible subfolder Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Do not invalidate main token on OAuthRoeland Jago Douma2018-09-061-3/+3
| | | | | | | | | | | | | | | | Fixes #10584 We deleted the main token when using the login flow else mutliple tokens would show up for a single user. However in the case of OAuth this is perfectly fine as the authentication happens really in your browser: 1. You are already logged in, no need to log you out 2. You are not logged in yet, but since you log in into the exact same browser the expected behavior is to stay logged in. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Don't use special chars to avoid confusionRoeland Jago Douma2018-05-221-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Improve login flowRoeland Jago Douma2018-04-081-0/+38
| | | | | | | * Add page explaining you are about to grant access * Show grant access page after login Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Request->getHeader() should always return a stringMorris Jobke2018-01-171-1/+1
| | | | | | | | PHPDoc (of the public API) says that this method returns string but it also returns null, which is not allowed in some method calls. This fixes that behaviour and returns an empty string and fixes all code paths that explicitly checked for null to be still compliant. Found while enabling the strict_typing for lib/private for the PHP7+ migration. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Fix bug with proxiesMario Danic2018-01-151-1/+12
| | | | Signed-off-by: Mario Danic <mario@lovelyhq.com>
* Clear login token once apppassword is generatedRoeland Jago Douma2018-01-041-0/+3
| | | | | | | | | | | | | Fixes #7697 When using the new login flow a token will be generated since we login. However after that we generate yet another token to return (as we should). However we should kill the current session token as we are done with it. And will never use it again. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix flowMario Danic2017-11-091-1/+10
| | | | Signed-off-by: Mario Danic <mario@lovelyhq.com>
* Theming: theme flow redirection pageJulius Härtl2017-11-081-1/+1
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Update license headersMorris Jobke2017-11-061-0/+5
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Fix undefined index oauthStateMorris Jobke2017-09-061-0/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Add tests for ClientFlowLoginControllerLukas Reschke2017-05-181-6/+4
| | | | Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Add OAuth state to sessionLukas Reschke2017-05-181-24/+18
| | | | Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* use name of oauth app to identify auth tokenBjoern Schiessle2017-05-181-2/+10
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* show error page if no valid client identifier is given and if it is not a ↵Bjoern Schiessle2017-05-181-5/+24
| | | | | | API request Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Remove special charactersLukas Reschke2017-05-181-1/+1
| | | | Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Add basic implementation for OAuth 2.0 Authorization Code FlowLukas Reschke2017-05-181-20/+72
| | | | Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Update login flow redirectionMario Danic2017-05-041-1/+1
| | | | Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* AppToken to 72 charsRoeland Jago Douma2017-04-251-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Do not remove the state token to earlyRoeland Jago Douma2017-04-251-1/+3
| | | | | | | we should check the stateToken before we remove it. Else the check will always fail. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Add new auth flowLukas Reschke2017-04-251-0/+236
This implements the basics for the new app-password based authentication flow for our clients. The current implementation tries to keep it as simple as possible and works the following way: 1. Unauthenticated client opens `/index.php/login/flow` 2. User will be asked whether they want to grant access to the client 3. If accepted the user has the chance to do so using existing App Token or automatically generate an app password. If the user chooses to use an existing app token then that one will simply be redirected to the `nc://` protocol handler. While we can improve on that in the future, I think keeping this smaller at the moment has its advantages. Also, in the near future we have to think about an automatic migration endpoint so there's that anyways :-) If the user chooses to use the regular login the following happens: 1. A session state token is written to the session 2. User is redirected to the login page 3. If successfully authenticated they will be redirected to a page redirecting to the POST controller 4. The POST controller will check if the CSRF token as well as the state token is correct, if yes the user will be redirected to the `nc://` protocol handler. This approach is quite simple but also allows to be extended in the future. One could for example allow external websites to consume this authentication endpoint as well. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>