-
Notifications
You must be signed in to change notification settings - Fork 189
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
Can't stay logged in to Desktop or Mobile app (Authentik OIDC with ocis_full 7.1.0) #10984
Comments
I am also wondering if there's a way to have the traditional login persist alongside the Authentik flow, so users can authenticate manually if need be. Can't figure that one out either! |
I'm having a hell of a time trying to get the mobile and desktop apps to authenticate. They are currently showing "Not Found," even after removing the providers from Authentik. To be honest, I don't want them to. I want to use Authentik for the web app, and let the mobile and desktops use regular auth. Does anyone know how to accomplish this? All I have now in my ocis.yaml is:
Besides those lines and the auth domain in config/ocis/csp.yaml, nothing else is changed from the standard ocis_full deployment |
Ok, here's some more weird behavior. I realized that I was trying to log into the desktop app with an existing local account. I removed that account and attempted to add it again. This is what happened: ![]() ![]() Oddly, when I deleted the account on the iOS app and added it again, it DID let me log in successfully with the entire auth flow. However, it immediately started to complain about access token expiration and logged me out. ![]() Trying to log back again yielded the familiar error: ![]() It seems that when there is an existing local user account, mapping cannot be done successfully to the server user. I am really unclear on the mapping tags (such as PROXY_AUTOPROVISION_ACCOUNTS=true which I had tried previously). @micbar can you provide some pointers here? |
Creating a new user allowed me to log into the Desktop app at long last. However, all file transfers fail after about 15 seconds. It seems the same token error as the iOS app is to blame. When the invalid token error occurs, the user is then logged out, and cannot log back in, because Authentik returns to the "Not Found" screen. I do have offline_access set up in my Authentik provider, with defaults as here: #5653 (comment) Here are logs:
|
@prohtex I am no longer part of this project. |
Sorry, I am no longer part of this project either. |
@prohtex seems the access token acquired from the client is expiring too fast. Does everything work when using web only? Maybe Authentik somehow uses another access token expiration for the clients? |
Hi @kobergj, thanks for getting back to me. Authentik is set with the generous defaults, as noted in #5653 (comment) The token expiry is just one issue however; when the user is logged out, trying to log back in gives the “Not found” error. The only way to successfully log in again is to delete the local user and add again. Only the initial auto flow works on mobile and desktop. |
@kobergj I just wanted to say that I really appreciate you taking the time to help me with this. I don't know what the circumstances are with devs shifting priorities or projects, but as a 10+ year user of OwnCloud legacy and SeaFile, it has been really something quite impressive to watch this project emerge and become so mature and robust so quickly. I first deployed OCIS 4 and have been testing, upgrading and migrating since then. What you guys have created is a world-class system, and I don't pretend to know where funding comes from or how it all works. For me, I'm small business owner and end user and I just really happy to have OCIS to work with and for all the wonderful tips and support of volunteers all over. So, again, thank you. What I did today: When I set out to integrate Authentik with my primary OCIS deployment a few days ago, I assumed the trouble I was encountering was due to a mix of outdated guides or breaking changes. Now I'm really stumped-I cannot for the life of me get this auth flow to work correctly for mobile or desktop. I know that some of the issues users have here on GitHub are on the level of support questions, and I'm grateful for any input. I also know that issues like this sometime turn up real bugs and I've been happy to contribute time to seeking them out (as with a few issues in OCIS Web so far). I am of course eager to get my Auth working. But I'm also available to help devs better the product, and if I can provide access to a test server, or additional logs, or anything else, please let me know. I'd really like to solve it. If you look at the Helge Klein article, there are some users in the comments section with similar as yet unsolved issues. Thanks! |
@prohtex Thank you very much for you warm words ❤ I've looked through the Helge Klein article, and found some interesting comment:
Is there any chance we have a similar situation here? Refresh Tokens not working correctly? Since this happening only with desktop and mobile apps, not with the web: @DeepDiver1975 do you have any idea why authentication would fail with desktop but succeed with the webclient? |
Nothing right out of my head. I suggest to use the latest desktop client 5.3.2, enable all logging https://doc.owncloud.com/desktop/next/appendices/troubleshooting.html#log-files and share these logs with us. |
I have seen refresh token errors, yes, but from what I understand, it is not necessary to set audience claim in Authentik (goauthentik/authentik#4021 (comment)). I do have my providers for Desktop and Moblie set to "confidential" per Helge:
When I set them to "Public" I do not see much difference. The mobile app logs in successfully then after a while: ![]() ![]() While I'm troubleshooting this, I was also hoping you could shed some light on some of the other parameters that might be useful for external auth. I've taken a look at this but it is more like a technical whitepaper and quite over my head: https://doc.owncloud.com/ocis/next/deployment/services/s-list/proxy.html & https://doc.owncloud.com/ocis/next/deployment/services/s-list/auth-service.html
I've tried fiddling with lots of parameters with no success. Lastly, is it in fact possible to enble local auth and external auth at the same time? Many web apps that work nicely with Authentik allow local auth and then add a button below that says "Authentik" that then begins the auth flow. From what I can tell, enabling external OIDC auth in OCIS creates an "OIDC" only flow from the web-is that correct? Thank you! |
|
there is no refresh token sent back to the client. To get the refresh token the scope must contain 'offline_access' - but this is set. |
That is correct: I noted the extensive discussion of offline_access elsewhere and made sure to set: However, I had disabled recently for troubleshooting. When I re-enabled offline_access, I am back to the terrible cycle above:
@kobergj @DeepDiver1975 I believe I finally found the relevant logs. This seems to be what is causing the user to be kicked out after a few minutes:
Is this the culprit?
|
405 upon calling the token endpoint is fishy |
I see: goauthentik/authentik#12087 fixed with PR goauthentik/authentik#12080 |
Hi @DeepDiver1975, thank you again SO much for your assistance here. At this stage, I'm not sure what else to try except various combinations of PROXY env vars, Authentik tweaks, etc. I note similar issues created by @Crashman1983 @fmoc @michaelstingl @ishioni @C8opmBM @kehralexander @IljaN @Yasamato @seriousm4x. I'm hopeful perhaps one of them has pointers or specific resolvers to attempt. Thank you all :) |
I have a fresh deployment of
ocis_full
running in Ubuntu. I'm adding Authentik OIDC auth with an auth server running on another machine.Steps:
ocis_full
7.1.0-rc4 and verify everything is workingPer https://doc.owncloud.com/ocis/next/additional-information/knowledge-base.html, the Helge Klein docs seem to be the supported method.
The text was updated successfully, but these errors were encountered: