@Override public List<AuthenticationFlowModel> getAuthenticationFlows() { if (updated != null) return updated.getAuthenticationFlows(); List<AuthenticationFlowModel> models = new ArrayList<>(); models.addAll(cached.getAuthenticationFlows().values()); return models; }
@Override public List<AuthenticationFlowModel> getAuthenticationFlows() { if (isUpdated()) return updated.getAuthenticationFlows(); return cached.getAuthenticationFlowList(); }
public static void exportAuthenticationFlows(RealmModel realm, RealmRepresentation rep) { rep.setAuthenticationFlows(new LinkedList<AuthenticationFlowRepresentation>()); rep.setAuthenticatorConfig(new LinkedList<AuthenticatorConfigRepresentation>()); List<AuthenticationFlowModel> authenticationFlows = new ArrayList<>(realm.getAuthenticationFlows()); //ensure consistent ordering of authenticationFlows. Collections.sort(authenticationFlows, new Comparator<AuthenticationFlowModel>() { @Override public int compare(AuthenticationFlowModel left, AuthenticationFlowModel right) { return left.getAlias().compareTo(right.getAlias()); } }); for (AuthenticationFlowModel model : authenticationFlows) { AuthenticationFlowRepresentation flowRep = toRepresentation(realm, model); rep.getAuthenticationFlows().add(flowRep); } List<AuthenticatorConfigModel> authenticatorConfigs = new ArrayList<>(realm.getAuthenticatorConfigs()); //ensure consistent ordering of authenticatorConfigs. Collections.sort(authenticatorConfigs, new Comparator<AuthenticatorConfigModel>() { @Override public int compare(AuthenticatorConfigModel left, AuthenticatorConfigModel right) { return left.getAlias().compareTo(right.getAlias()); } }); for (AuthenticatorConfigModel model : authenticatorConfigs) { rep.getAuthenticatorConfig().add(toRepresentation(model)); } }
public void migrate(KeycloakSession session) { List<RealmModel> realms = session.realms().getRealms(); for (RealmModel realm : realms) { if (realm.getAuthenticationFlows().size() == 0) { DefaultAuthenticationFlows.migrateFlows(realm); DefaultRequiredActions.addActions(realm); } ImpersonationConstants.setupImpersonationService(session, realm); migrateLDAPMappers(session, realm); migrateUsers(session, realm); } }
supportedLocales.addAll(model.getSupportedLocales()); defaultLocale = model.getDefaultLocale(); for (AuthenticationFlowModel flow : model.getAuthenticationFlows()) { authenticationFlows.put(flow.getId(), flow); authenticationExecutions.put(flow.getId(), new LinkedList<AuthenticationExecutionModel>());
supportedLocales = model.getSupportedLocales(); defaultLocale = model.getDefaultLocale(); authenticationFlowList = model.getAuthenticationFlows(); for (AuthenticationFlowModel flow : authenticationFlowList) { this.authenticationFlows.put(flow.getId(), flow);