Hello,
I am trying to integrate a custom auth provider with nextcloud. I have an external server that has an api which will check a token to verify if the user is looged in to the auth provider. My thought on how to do this was to override \OCP\IUserSession to check the external API instead of the server session. The issue I am having is I can’t figure out how to register the new IUserSession. I have created an app, and in the registration method of lib/AppInfo/Application.php have tried both:
$context->registerService(\OCP\IUserSession::class, function(){
return new NTSession();
});
and
OC::$server->registerAlias(\OCP\IUserSession::class, NTSession::class);
The first appears to do nothing, and the second errors out with a message “Fatal error: Cannot declare class OCA\NewtechServices\Auth\NTSesssion, because the name is already in use in /var/www/html/custom_apps/newtechservices/lib/Auth/NTSession.php”
Ami doing this completely wrong? How are you ssupposed to register new implementations of the User Session?