zorn-v / nextcloud-social-login

GNU Affero General Public License v3.0
199 stars 138 forks source link

Post-fix of "$provider-" for username generation? #258

Closed decentral1se closed 3 years ago

decentral1se commented 3 years ago

Using keycloak and social login on NC along with this mapper approach (see under "Cryptic Usernames" section), I am able to get a uid+username format which ends up looking like keycloak-$username. That is much better than keycloak-$uuid-$username for sharing and having human referencable usernames in UIs.

However, having keycloak- at the front of it is not ideal. It would be great to have it at the end, as a post-fix. The reasoning: in most interfaces only the first x characters are shown and so everyone is called "keycloak". Would it possible to move post-fix approach for the custom oauth provider setup?

I am looking at the following line:

https://github.com/zorn-v/nextcloud-social-login/blob/50c1dd52b040e30e71b0d8384b4b4d1e966fa40f/lib/Service/ProviderService.php#L363

zorn-v commented 3 years ago

It is not possible. What should we do with already created users ?

You can search users by "display name" not by "uid".

decentral1se commented 3 years ago

We went with https://github.com/pulsejet/nextcloud-oidc-login.

mcejp commented 3 years ago

@decentral1se Thanks for the tip, this looks excellent!

xMAC94x commented 2 years ago

Hi @zorn-v, one could at least create a config to not have a hardcoded prefix here. 2 Reasons why this might be useful:

  1. You are setting up a nextcloud server where no already created users exist.
  2. Actually this prefix doesn't guarantee that the username didn't exist. We could had a already created user that was called keycloak-foo I would propose an additional flag in "Custom OpenID Connect" where one could specify a UserPrefix keycloak- and GroupPrefix keycloak- or just no prefix at all, what speaks against this proposal ?