Giter Club home page Giter Club logo

Comments (11)

isdnfan avatar isdnfan commented on July 28, 2024 3

Nextcloud group provisioning works very straight forward - based on the OIDC claim it adds/removes the user from the groups (and auto-creates NC groups if needed).

Mapping the group can be done easily, hardest part is on Authentik side. here my setup using custom claim "roles"

in Authentik create custom property mapping (my code is little more complex as I want the groups in Authentik to have application related prefix "dev-nc_" in this case but don't want to see this prefix in NC so I remove the in the mapping)

image

in provider > advanced settings add the custom mapping

image

in application > preview verify the "roles" claim was added:

image

in NC user_oidc settings map the claim and enable group provisioning

image

review the process with more details here: https://24xsiempre.com/en/kasten-k10-authentik/

from user_oidc.

TheManchineel avatar TheManchineel commented on July 28, 2024 1

@isdnfan thanks! This worked wonderfully

In my case, this is what I did:

nc_groups = [
  (i.name if i.name != "Nextcloud Admins" else "admin") for i in request.user.ak_groups.all()
]

return {
  "nc_groups": nc_groups
}

then enabled the mapping for the Nextcloud provider, and on the NC side I enabled group provisioning and added the nc_groups mapping as the source attribute.

This way all groups are automatically provisioned on Nextcloud with the same name as appear on Authentik, except for the "Nextcloud Admins" group which is mapped to "admin" (a hardcoded group name on Nextcloud for admin users).

One question: is there any way to have groups "sync" earlier than the next token expiration/sign in?

from user_oidc.

TheManchineel avatar TheManchineel commented on July 28, 2024

Funny enough, I've made the exact same journey as you and ended up where you're currently at. Did you ever figure this out?

from user_oidc.

Ra72xx avatar Ra72xx commented on July 28, 2024

No. I ended up re-creating the necessary Authentik groups locally in Nextcloud (for my small setup). However, this is not really an elegant solution...

from user_oidc.

TheManchineel avatar TheManchineel commented on July 28, 2024

Figured to do just as much. Obviously this would be a pain in any kind of large/enterprise installation. For my own personal use it "works" I guess...

from user_oidc.

Ra72xx avatar Ra72xx commented on July 28, 2024

It would be really great if this IMHO very basic setup would get some more end-user documentation. I can't really image that we two are the only ones wanting to use the OIDC provider's group setup in die OIDC-enabled application ;-) .

from user_oidc.

Ra72xx avatar Ra72xx commented on July 28, 2024

BTW, has anybody a mapping to use Authentik avatars in Nextcloud?

from user_oidc.

Ra72xx avatar Ra72xx commented on July 28, 2024

Unfortunately, I don't get any of the versions above to work. As soon as I enable group provisioning, the user gets thrown out of any group on the next login. E.g. for the example of @TheManchineel

Nextcloud user_openidc:
Eingefügtes Bild

Authentik:
Eingefügtes Bild 1
Eingefügtes Bild 2

Am I misunderstanding something? If I try the property mapping with the test icon in the property mapping section, it seems to work as expected. I don't have "Application>Preview" button?!

from user_oidc.

wrenix avatar wrenix commented on July 28, 2024

How to set this programmatically? there is no --mapping-groups= in the occ user_oidc:provider command

from user_oidc.

ManfredWisniewski avatar ManfredWisniewski commented on July 28, 2024

@Ra72xx did you ever resolve this? I am having the same problem. Everytime my users log in they are thrown out of the groups that I assigned them.

from user_oidc.

Ra72xx avatar Ra72xx commented on July 28, 2024

No, I did not further attempts to solve this issue.

from user_oidc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.