[keycloak-user] Update Email Settings for Realms

Rodel Talampas rodel.talampas at helixleisure.com
Mon Mar 6 04:21:39 EST 2017


Hi,

I have this piece of code to update the Realms' Email Settings coming from master.
It seems correct but it doesn't update the above. What am I Doing wrong?

@Override
    public void updateEmailFromMaster(String realmName) {
        RealmModel masterRealm = session.realms().getRealmByName("master");
        RealmModel realm = session.realms().getRealmByName(realmName);
        realm.setSmtpConfig(masterRealm.getSmtpConfig());
        RealmRepresentation rep = ModelToRepresentation.toRepresentation(realm, false);
        RepresentationToModel.updateRealm(rep, realm, session);

    }

Thanks and regards,
Rodel





More information about the keycloak-user mailing list