hypery2k / owncloud

In this repo you'll find apps and enhancements for owncloud
Other
156 stars 85 forks source link

OC-Autologin does not work with roundcube app #343

Closed hypery2k closed 8 years ago

hypery2k commented 9 years ago

The "post_login" is only fired from within the "OCP\Util", when the end-user does a manual OC login screen .... oc-manual-login When the end-user has checked the "remember password" checkbox in the OC login screen, the next time the user starts up his browser, and enters his owncloud URL, the user will be automatically loggin in, and in that case, the "post_login" is NOT fired from within the "OCP\Util", and the user will not be logged in to the Rouncube API.

hypery2k commented 9 years ago

To me it's no bug in OC, but I'm not sure how to resolve this within the app, Maybe it's possible to use a cookie within roundcube for this...

Would be a new feature ...

Fmstrat commented 9 years ago

This is speculation, but could you:

... and then admins could ensure that the cookie expiration settings for RoundCube is suitably longer than OC's?

This would still result in an error if you logged into OC, left, then came back and tried to enter Webmail. However, with the auto-logout, when they log back in, it would then save their credentials. It's not ideal, but could work.

mckaygerhard commented 9 years ago

the lasted its a spected behavior that could not be solved as easy and it will unless a single sig on will be make for oc and rc projects.. so far i thinks its a possible solution...

the second (if a faild occurs) i dont understand why the logout? why not forcing ?

Fmstrat commented 8 years ago

Question, in this code: https://github.com/hypery2k/owncloud/blob/8f701beb901c59141d9321fcf6fc509359d3813d/roundcube/src/main/php/lib/RoundCubeAuthHelper.class.php#L75

... you've got a line that decrypts the stored username and password for manual login. Is there a reason you couldn't take the login function that runs on post_login, and store the mail_username and mail_password from here: https://github.com/hypery2k/owncloud/blob/8f701beb901c59141d9321fcf6fc509359d3813d/roundcube/src/main/php/lib/RoundCubeAuthHelper.class.php#L66 in that same way?

I.E. a new auto-login method that populates/updates the manual login whenever a user logs into OC. Then use the same "manual" login function all the time.

As for why the logout above, currently a "settings" button is displayed. If the user is not an Admin, this just breaks. Logging them out would force them to log back in, thus giving them access to webmail. It's a cheat, but at least keeps from showing errors.

hypery2k commented 8 years ago

feel free to open a PR. I think I quit developing OwnCloud apps Sorry to say,

mckaygerhard commented 8 years ago

i also working around that, but the oc api are very confusing for my little knowlegd between versions and in my company we uses a oc 7 with own patches and support, i also think that i will use only oc 5 with rc-oc that works very well in we next deploy of "a intranet".

Fmstrat commented 8 years ago

@mckaygerhard The method I mentioned above wouldn't require any additional API development. It would just be replicating the storage method used in the non-autologin version for the autologin version. If I get time, I'll try that method.

mckaygerhard commented 8 years ago

no! i mean that i was trying resolve by another way some month ago... i'll be apreciated if you have time and work in this , but remenber make support for OC 7! and OC6 due app its still working with oc 6 and oc7

Fmstrat commented 8 years ago

@hypery2k Can I even do a PR from here? Seems the appinfo/version file here is 2.5.1, but the one in release on apps.owncloud.com is 2.6.1?

mckaygerhard commented 8 years ago

u can do it! please feel free to do, that's only a mistake in the file

mckaygerhard commented 8 years ago

no! waith lasted commits fixed that! well make the pull and let's see that will conflict, or i recomended sync u'r repository

Fmstrat commented 8 years ago

@mckaygerhard Oh, haha my fault. I forgot I worked on this repository before for supporting Roundcube Beta. When I hit Fork it didn't update I think.

hypery2k commented 8 years ago

you can directly push to this repo. You have write access

mckaygerhard commented 8 years ago

fixed with lasted issue fixeds see # commits 19d83d1 and 0947e9a, now works!

mckaygerhard commented 8 years ago

fixed with lasted issue fixeds see #368 commits 19d83d1 and 0947e9a, now works!