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

unable to disable 'auto_provision' #869

Closed
epifanio opened this issue May 14, 2024 · 4 comments
Closed

unable to disable 'auto_provision' #869

epifanio opened this issue May 14, 2024 · 4 comments
Labels
priority: normal question Further information is requested

Comments

@epifanio
Copy link

epifanio commented May 14, 2024

Hi,

I have enbled user_oidc - and i can log-in with my provider, but I need to create users manually and avoid user_oidc auto-provisioning.

I tried to create an user manually from the NextCloud Admin interface, and the set auto-provisioning to false in my config.php by adding:

  'user_oidc' => [
    'auto_provision' => false,
  ],

But then, when I try to log-in with my provider, user_oidc is refusing to log-in and prompt me to the following message:

Access forbidden

Failed to provision the user

Am I doing something wrong?

maybe somethinbg missing in the way how I configure user_oidc ?

I left empty the following section:

Attribute mapping

    User ID mapping

And I have the following as scope:

openid email profile

Thanks for any help!

--- edit ---

I see from the docs:

When soft_auto_provision is disabled
We refuse Oidc login of users that already exist in other backends

Does this means that if I manually create a user, I can not use OIDC login?
It looks like OIDC is not detecting that the user already exist .. I am probably missing something in the settings :(

@epifanio
Copy link
Author

it was a mapping issue, I finally fixed it by setting "preferred_username" as username mapping from my log-in provider

  • found some clue from the "well-known/openid-configuration" provider link

@classical
Copy link

it was a mapping issue, I finally fixed it by setting "preferred_username" as username mapping from my log-in provider

  • found some clue from the "well-known/openid-configuration" provider link

Please show me more detail to fix it. I get the same issue also

@edward-ly edward-ly added the bug Something isn't working label Sep 17, 2024
@epifanio
Copy link
Author

our OIDC provider is issuing the following info as claims_supported:

["aud","sub","iss","auth_time","name","given_name","family_name","preferred_username","email","acr"],

I had to change the nextcloud oid settings to mapp the Uid to preferred_username

in our config, shown via: ./occ user_oidc:provider provider_name
i now have: "mappingUid": "preferred_username",

Now if we add an user with the same username used in the provider, the user can log-in - this is ok but suboptimal, as we now need to know the username before adding the user ... ideally we want to use the email address - but not sure where to add it in the UI settings - our config is empty for the email settings: "mappingEmail": "",

@edward-ly edward-ly added question Further information is requested priority: normal and removed bug Something isn't working labels Oct 3, 2024
@edward-ly
Copy link
Contributor

Closing as the discussion seems to be resolved now. The email address should be provided through the email claim/scope which should be enabled by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: normal question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants