Skip to content
This repository has been archived by the owner on Jul 18, 2018. It is now read-only.

owncloud 9.1 compatibility #37

Open
nicktruch opened this issue Sep 29, 2016 · 16 comments
Open

owncloud 9.1 compatibility #37

nicktruch opened this issue Sep 29, 2016 · 16 comments

Comments

@nicktruch
Copy link

Hello,
I've tried to install user_cas on ownCloud 9.1.
As described by @nagai-takayuki in his #36 pull request, due to a lot of changes in class structure and the change in authentication framework, user_cas won't work in OC 9.1.
Problem is whatever version I install (yours or nagai's one), I get an error.
So my question is : does anybody succeeded in installing user_cas on OC 9.1 ?
Thanks in advance for your help?
Nicolas

@nicktruch
Copy link
Author

nicktruch commented Sep 29, 2016

OK I think I found what wasn't working :

In @nagai-takayuki user_cas branch, I hadn't set the path to the phpCAS library in user_cas.php / ligne 72 :
$php_cas_path=OCP\Config::getAppValue('user_cas', 'cas_php_cas_path', 'CAS.php');
Once installed you can modify this value from the admin CAS Authentication backend panel.

Hope this helps,
Nicolas

@felixrupp
Copy link

No chance for me. I don't get it to work, even if i put in the CAS-Library path as hardcoded string.

@felixrupp
Copy link

felixrupp commented Oct 22, 2016

I dropped LDAP-Backend support and fixed several other things in my Fork: https://github.com/felixrupp/user_cas
On my 9.1 installation this version is now working as expected.
The main cause of this problem is a weird bug that prevents extending the User_LDAP class from the user_ldap extension, although namespace and classname is correct. Could not find a reason for this.

I assume this is a problem caused by bad programming style and missing namespaces. Overall this app has to be rewritten in my opinion.

@pitbulk
Copy link
Contributor

pitbulk commented Oct 25, 2016

Hi @felixrupp,

you are right, I created this user_cas on Dec 2012 for Owncloud 4 (that used no namespace) and after that, nobody updated it properly to make it compatible with OC, just fast patches.
I'm not involved on OC project anymore and I think this repo is not maintained right now so maybe if you interested you can handle it.

@mttq
Copy link

mttq commented Nov 9, 2016

Hi @felixrupp

I've just installed Your user_cas on OC 9.1.1 on Centos 7.2.1511

After the successful CAS login OC show the login page again.

if i try to login (in this page) with another user, the login failed.

Any idea?

Thanks.
m.

@felixrupp
Copy link

I'll do some tests with a 9.1.1 installation this week. Can you give me any messages from the owncloud or apache log files?

@mttq
Copy link

mttq commented Nov 10, 2016

Hi @felixrupp,

here some messages after OC CAS Login:

From owncloud log:
{"reqId":"WCRUgVxKmWzZC0k4r9NEWwAAAAU","remoteAddr":"139.xxx.xxx.xxx","app":"PHP","message":"Undefined index: cn at /var/www/html/owncloud/apps/user_cas/lib/hooks.php#51","level":3,"time":"2016-11-10T11:05:37+00:00","method":"GET","url":"/owncloud/index.php/login?app=user_cas","user":"myuser"}
{"reqId":"WCRUgVxKmWzZC0k4r9NEWwAAAAU","remoteAddr":"139.xxx.xxx.xxx","app":"PHP","message":"Undefined index: mail at /var/www/html/owncloud/apps/user_cas/lib/hooks.php#56","level":3,"time":"2016-11-10T11:05:37+00:00","method":"GET","url":"/owncloud/index.php/login?app=user_cas","user":"myuser"}

And from access_log:
xx.xxx.xxx.xxx - - [10/Nov/2016:12:05:36 +0100] "GET /owncloud/index.php/login?app=user_cas HTTP/1.1" 302 353 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0"
xxx.xxx.xxx.xxx - - [10/Nov/2016:12:05:37 +0100] "GET /owncloud/index.php/login?app=user_cas&ticket=ST-480940-GPcxc9qCozRpCXdKTZmW53kmgM88Qb43b3Ku2GSHzXkL02hClDcAoYfVQ1YjuVMLkBOGmVSdslClE470GEra9T-Jj71zxYb8yrc1ib5J934Wi-8nK2ehHzIBSOxrlek3XEtAMzznZhmc5CMzkiGddKg0rv HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0"
xxx.xxx.xxx.xxx - - [10/Nov/2016:12:05:37 +0100] "GET /owncloud/index.php/login?app=user_cas HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0"
xxx.xxx.xxx.xxx - - [10/Nov/2016:12:05:37 +0100] "GET /owncloud/index.php/apps/files/ HTTP/1.1" 303 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0"
xxx.xxx.xxx.xxx - - [10/Nov/2016:12:05:38 +0100] "GET /owncloud/index.php/login?redirect_url=%252Fowncloud%252Findex.php%252Fapps%252Ffiles%252F HTTP/1.1" 200 3507 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0"
xxx.xxx.xxx.xxx - - [10/Nov/2016:12:05:38 +0100] "GET /owncloud/index.php/core/js/oc.js?v=933f7361dcf68d34b554e0e67532dacd HTTP/1.1" 200 2861 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0"
xxx.xxx.xxx.xxx - - [10/Nov/2016:12:05:39 +0100] "GET /owncloud/cron.php HTTP/1.1" 200 20 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0"

@felixrupp
Copy link

Hi @mttq,

can you please append the error.log entries from your apache server?

The owncloud log only shows the debug warnings for some non-mapped CAS Attributes. The cn isn't mapped in most cases, mail should be mapped, but as long as owncloud is using usernames and not e-mails for authentication, this shouldn’t be a problem.

Your access.log file only shows the successful requests, not the errors appearing in a request.

Thanks in advance, I'm planning to find and fix the issues this Weekend.

@felixrupp
Copy link

Hi @mttq,

I did several test runs on Debian 8 and Ubuntu 12 Installations with both PHP 5.6 and 5.5 on OC 9.1.1. On both machines, my current user_cas master-branch was working.

Please hold in mind, that after the installation of user_cas, you have to provide the path to CAS.php hardcoded in the user_cas.php file line 72 as stated in @nicktruch 2nd comment on this page . After you have accessed the admin panel and saved the real path in the settings, you can revert your changes in user_cas.php file line 72.
Please also hold in mind, that the current master branch version has dropped LDAP support. So if you’re using LDAP authentication in Owncloud, this user_cas version will NOT authenticate against your LDAP.

Your specific problem is triggered by the login mechanism of current user_cas implementation. Clicking the login button redirects to [your-oc]/index.php?app=user_cas, which is then filtered by the app. The apps logic then decides to redirect the user to the CAS instance, if necessary. There you log in and get redirected back to [your-oc]/index.php?app=user_cas, providing a CAS token. The app then tries to log you in your owncloud, based on the username alone.
After that, the app checks if you have a valid CAS token and a valid OC token. If one of both checks fails, it redirects back to the login page but disables the „CAS Login“ button.

I assume that’s what’s happening to you?

There might be several possibilities:

  1. You don’t have a valid CAS token. Please check if your CAS login works correctly (e.g. on other services in your infrastructure).
  2. You have a valid CAS token, but the app fails to authenticate you against owncloud. That could be caused by non-matching usernames. Check if your CAS or your owncloud username has been changed.
  3. You logged in on owncloud by not using CAS, you came back to the login panel and tried logging in via CAS. Your CAS login proceeds, but you already had an owncloud access token, which then results in sending you back to the login page.

Please be sure to completely log out from your CAS service and then also delete all cookies related to this owncloud instance and your CAS. Alternatively you can try another, fresh browser.

Please retry after checking steps 1 to 3 and report back. As said, I'm currently working on the complete rewrite of user_cas, based on 9.1 app design guidelines. It’s currently at 80% complete. Please stay patient!

Thank you!

@mttq
Copy link

mttq commented Nov 15, 2016

Hi @felixrupp ,

thanks a lot for Your support!!!!
Now It seems working well!

There was an error with the PHP after the OS upgrade... :-(

Please let me know when the new user_cas will be ready!!!
Thanks again!
Bye.
mttq

@mttq
Copy link

mttq commented Feb 28, 2017 via email

@felixrupp
Copy link

Hi @mttq,

still working on that loop-issue, I hope to release a hotfix in a few days! Please consider the rewrite alpha, as it is not yet throroughly testet!

Regardless of that, it seems you have an issue with your php-session IDs being to long or containing bad characters.

@felixrupp
Copy link

Hi @mttq @nicktruch and everybody else,

I just released the 1.4.5 version of my user_cas rewrite with OC 10 only support. After a few struggles with 9.1, this version is currently working very well on OC 10 installations. It has also almost all features of the old style user_cas version. The only thing missing is the ldap support, which is part of my next scheduled feature set.

Please report any issues/feature requests you have to the issue tracker on my repository, otherwise I will not be able to find and read them in time.

Have fun with it!

Felix

@mttq
Copy link

mttq commented Sep 29, 2017 via email

@felixrupp
Copy link

Hi @mttq

Yes it is! The current release version 1.4.7 is targeted at OC 9.1.6 and OC 10.0

Greetings,

Felix

@mttq
Copy link

mttq commented Sep 29, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants