Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Auth is broken - again... #3487

Merged
merged 5 commits into from Jul 14, 2013
Merged

Basic Auth is broken - again... #3487

merged 5 commits into from Jul 14, 2013

Conversation

tanghus
Copy link
Contributor

@tanghus tanghus commented May 25, 2013

This is most likely not the 'proper' way to do it, but it works.

Please test Basic Auth whenever refactoring the code. I don't know how many time is has been broken.

@icewind1991 @DeepDiver1975 @karlitschek

@ghost ghost assigned icewind1991 May 25, 2013
@karlitschek
Copy link
Contributor

is it intended that you commented out redirectToDefaultPage ?

@tanghus
Copy link
Contributor Author

tanghus commented May 25, 2013

is it intended that you commented out redirectToDefaultPage ?

Yes, it went into a never ending loop otherwise. When commented out it reaches the destination URL.

@tanghus
Copy link
Contributor Author

tanghus commented May 25, 2013

Actually since basic auth is mainly (only?) used for non-browser access, maybe we should call OC_Util::callRegister() in tryBasicAuthLogin(), as it only called in the template otherwise.
I don't know if it would have any security implications, @LukasReschke ?

@bantu
Copy link

bantu commented May 30, 2013

The ticket description indicates there should be functional tests for HTTP auth now. ;)

@tanghus
Copy link
Contributor Author

tanghus commented May 30, 2013

It's basically untestable, and the login logic is - absent... I' trying to make heads and tails out of it.

@tanghus
Copy link
Contributor Author

tanghus commented May 30, 2013

Nope, without a total redesign this is the only way I can get basic auth to work, without breaking normal login, cookie validation and routing.

Cookie validation is already broken in master - #854 really needs to be fixed.

Anyways, until a redesign of the startup procedure, please consider this patch.

@karlitschek @icewind1991 @LukasReschke @DeepDiver1975

@MTGap
Copy link
Contributor

MTGap commented May 30, 2013

3rdparty got changed in the last commit.

Should we organize a review of base.php to clean up the login stuff? I don't want to do it alone.

@tanghus
Copy link
Contributor Author

tanghus commented May 30, 2013

3rdparty got changed in the last commit.

Thanks, hadn't noticed.

Should we organize a review of base.php to clean up the login stuff?

Maybe we should create an issue summarizing all the issues in OC::handleRequest(); and separate them into more manageable parts? Find out what pitfalls there are etc.

I don't want to do it alone.

No one should have that burden alone ;)

@tanghus
Copy link
Contributor Author

tanghus commented May 30, 2013

But if we are going to rewrite anyway, I think we should consider a design like SabreDAV, instantiating a server object and inject plugins for dealing with authentication, handling requests etc.

@icewind1991
Copy link
Contributor

But if we are going to rewrite anyway, I think we should consider a design like SabreDAV, instantiating a server object and inject plugins for dealing with authentication, handling requests etc.

👍

@@ -678,9 +680,8 @@ protected static function handleLogin() {
$error[] = 'invalidpassword';

// The user is already authenticated using Apaches AuthType Basic... very usable in combination with LDAP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tanghus should the comment be moved as well? Just asking

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it probably should ;) This hack was mostly a PoC what would work with the current base.php - a rewrite would be better but might not be feasible before the next major release? If not, tryBasicAuth() should also call OC_Util::callRegister(); if the request should be used for anything else than simple GETs.
Should I update this PR for something that can be work, or should we prioritize a rewrite like @icewind1991 described in https://gist.github.com/icewind1991/5685072 for oC 6?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OC5 and master are broken - right? -> fix it
The rewrite is too far away from my understanding.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DeepDiver1975 Yes, oC5 is broken too. Pushed changes for master.

@tanghus
Copy link
Contributor Author

tanghus commented Jun 6, 2013

Any 👎 or 👍 for this temporary fix? A full rewrite is only in the far horizon.

@icewind1991
Copy link
Contributor

👍

@tanghus
Copy link
Contributor Author

tanghus commented Jun 27, 2013

@MTGap @karlitschek @DeepDiver1975 what say you?

@DeepDiver1975
Copy link
Member

👍

DeepDiver1975 added a commit that referenced this pull request Jul 14, 2013
Basic Auth is broken - again...
@DeepDiver1975 DeepDiver1975 merged commit 6f5b0af into master Jul 14, 2013
@DeepDiver1975
Copy link
Member

@tanghus oc5 is still broken - right? Can you please backport this? THX

@DeepDiver1975 DeepDiver1975 deleted the basic_auth_hack branch July 14, 2013 21:57
@tanghus
Copy link
Contributor Author

tanghus commented Aug 7, 2013

oc5 is still broken - right? Can you please backport this? THX

@DeepDiver1975 I deleted 2500 git msgs when I got back from vacation, so never saw this :)
Yes, stable5 seems to be broken as well. I'll see if I can backport this.

tanghus added a commit that referenced this pull request Aug 7, 2013
@tanghus tanghus mentioned this pull request Aug 7, 2013
@lock lock bot locked as resolved and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants