Giter Site home page Giter Site logo

Comments (2)

daniel-frak avatar daniel-frak commented on September 10, 2024

Handling user groups during migration sounds like a great idea!

That said, I think we might need some additional configuration for group mapping (similar to how it's currently handled for roles) - that is, a group map and a toggle to migrate unmapped groups.

That will also resolve the problem of "what to do if a group doesn't exist" - we should add it if the toggle is ON and ignore it if it's OFF (and actually ignore any groups not present in the group map in that case).

Adding the new config options means we should probably also update the screenshot in the Optional - additional configuration section of the README.md.

Last but not least, this will most likely require updating the User DTO to include a groups field of some sort - this field should not be mandatory and should be documented as such in README.md.

If you're up for it, that would be a great contribution to the project :)

from keycloak-user-migration.

ndeitch avatar ndeitch commented on September 10, 2024

Sounds great!

I updated issue with requirements for this feature, this the local implementation I did:

if (legacyUser.getGroups() != null) {
    legacyUser.getGroups().forEach(group ->
            ofNullable(realm.getGroupById(group)).ifPresentOrElse(
                    userModel::joinGroup,
                    () -> userModel.joinGroup(realm.createGroup(group))
            )
    );
}

I'll open this PR in the next few days

from keycloak-user-migration.

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.