Skip to content
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

Add nextcloud OIDC provider #1821

Closed
wants to merge 1 commit into from
Closed

Add nextcloud OIDC provider #1821

wants to merge 1 commit into from

Conversation

nat212
Copy link

@nat212 nat212 commented Feb 10, 2023

Nextcloud has an app that allows you to use your instance as an OpenID Connect provider (https://github.com/H2CK/oidc/wiki/User-Documentation). I personally use this to manage access to my personal apps, and having this in pocketbase would be useful!

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Feb 10, 2023

Thank you for working on this but I'm not sure if it will be a good idea to integrate it in the main package because this doesn't seem to be an officially Nextcloud supported OAuth2 app, right? Also I couldn't find anywhere whether they support the PKCE flow or not (this is not required and #55 will help further, but it would be nice if it is documented somewhere).

Additionally, we have to check whether the provider will always return the email even if it is not verified because in this case we cannot trust it and it would be better to not set the email since it is used for accounts linking. Usually some providers have email_verified/emailVerified or similar field that identifies the email state but I'm not sure if that's also the case with this provider.

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Feb 10, 2023

Additionally, Nextcloud seems to have their own OAuth2 integration without the need of the external app - https://docs.nextcloud.com/server/16/admin_manual/configuration_server/oauth2.html, but the documentation is very limited and I'm not sure if the above will work with it (there is no information on the scopes or the responses).


Update:
I've found in a newer doc version https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/oauth2.html#oauth2:

Nextcloud OAuth2 implementation currently does not support scoped access. This means that every token has full access to the complete account including read and write permission to the stored files. It is essential to store the OAuth2 tokens in a safe way!

Without scopes and restrictable access it is not recommended to use a Nextcloud instance as a user authentication service.

In this case I'm not sure if it will be a good idea to integrate with Nextcloud at this stage since I don't want to rely on non-officially maintained integrations. There is an existing issue for adding scopes in nextcloud/server#26233 but seems to be marked as stale and based on the comments there is no indication that they plan to implement it anytime soon.

Since oidc-like providers are fairly similar, to some extend you should be able to use the already existing Authentik integration (I'll consider mentioning it in the Admin UI sometime in the future).

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

Successfully merging this pull request may close these issues.

None yet

2 participants