-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Custom Authentication Mechanisms for WebDAV and APIs #26742
Conversation
@joneug, thanks for your PR! By analyzing the history of the files in this pull request, we identified @DeepDiver1975 to be a potential reviewer. |
@PhilippSchaffrath @Peter-Prochaska |
* Most of the logic is handled, implementors just need to worry about | ||
* the determineUsername method. | ||
*/ | ||
abstract class AbstractBearer implements BackendInterface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this class already exists in sabre dav - no need to add it here. THX
Linking #24995 |
@PhilippSchaffrath @DeepDiver1975 @butonic Please review the changes. Looking forward to your ideas. |
I think the problem with the build failing in Jenkins is that the OAuth 2.0 app was added as a Submodule which requires additional commands for cloning. Would you like to use submodules or should I include the OAuth 2.0 app's files directly? |
User Hooks are currently not triggered because of the missing password
The dependencies between the core and the
I added
I updated the
I added the function |
I changed the title of the PR, because now OAuth 2.0 is fully capsulated in the app and this PR addresses the more general problem of adding 3rd-party authentication backends. Furthermore, I added the function As a side note: in the OAuth 2.0 app an empty string is returned because we are not handling any passwords at all. Consequently, only master key encryption is working, but this restriction exists when using Shibboleth, too. Lastly, I added loading of additional AuthBackends for the webdav interface. |
Could you please review the changes? Additionally, considering a backport to |
*/ | ||
public function tryAuthModuleLogin(IRequest $request) { | ||
/** @var IAppManager $appManager */ | ||
$appManager = OC::$server->query('AppManager'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please inject appManager as parameter in the ctor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to inject the AppManager, but when changing the registration of UserSession
in Server.php
(see here) I get the following error:
PHP Fatal error: Maximum function nesting level of '256' reached
Inside the closure for the registerService
function, $appManager = $c->getAppManager();
is called over and over again. Any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay then let's keep it this way
} | ||
|
||
/** @var IAuthModule $authModule */ | ||
$authModule = OC::$server->query($class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding a type check?
if ($authModule instanceof IAuthModule) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
hmmm ... two tests are failing on oracle ....
|
I pulled the changes in
Are there errors in the build script (see changes of commit cac897b)? |
I'd say this is unrelated ..... let's merge |
Thanks a lot! @joneug and your team! Great job! |
What do you think about backporting to 9.1?
|
@PVince81 what's your opionion? THX |
I created a backport in PR #27370. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
The authentication mechanisms for securing WebDAV and APIs were extended to allow 3rd-party apps to provide additional authentication backends. In the WebDAV interface the dispatching of the
OCA\DAV\Connector\Sabre::authInit
event was added. For securing the API the interfaceIAuthModule
was added. Apps can register their implementation of this interface in theinfo.xml
file.Related Issue
#10400
Motivation and Context
This, for example, allows the implementation of Bearer Authentication with OAuth 2.0 (see OAuth 2.0 app).
How Has This Been Tested?
The OAuth2 app's PHPUnit tests have been run on Travis CI with the following configurations:
Screenshots (if appropriate):
Types of changes
Checklist: