diff --git a/connections/jpa-liquibase/src/main/resources/META-INF/jpa-changelog-1.5.0.xml b/connections/jpa-liquibase/src/main/resources/META-INF/jpa-changelog-1.5.0.xml index 4866834caa..c80f25c6a8 100755 --- a/connections/jpa-liquibase/src/main/resources/META-INF/jpa-changelog-1.5.0.xml +++ b/connections/jpa-liquibase/src/main/resources/META-INF/jpa-changelog-1.5.0.xml @@ -43,6 +43,15 @@ + + + + + + + + + diff --git a/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java b/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java index d93a0d693d..43aeb613a3 100755 --- a/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java +++ b/core/src/main/java/org/keycloak/representations/idm/RealmRepresentation.java @@ -87,6 +87,9 @@ public class RealmRepresentation { protected List authenticationFlows; protected List authenticatorConfig; protected List requiredActions; + protected String browserFlow; + protected String registrationFlow; + protected String directGrantFlow; @Deprecated protected Boolean social; @@ -708,4 +711,28 @@ public class RealmRepresentation { public void setOtpPolicyPeriod(Integer otpPolicyPeriod) { this.otpPolicyPeriod = otpPolicyPeriod; } + + public String getBrowserFlow() { + return browserFlow; + } + + public void setBrowserFlow(String browserFlow) { + this.browserFlow = browserFlow; + } + + public String getRegistrationFlow() { + return registrationFlow; + } + + public void setRegistrationFlow(String registrationFlow) { + this.registrationFlow = registrationFlow; + } + + public String getDirectGrantFlow() { + return directGrantFlow; + } + + public void setDirectGrantFlow(String directGrantFlow) { + this.directGrantFlow = directGrantFlow; + } } diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js index 878f13da57..19a3562ccb 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js @@ -1087,6 +1087,21 @@ module.config([ '$routeProvider', function($routeProvider) { }, controller : 'AuthenticationFlowsCtrl' }) + .when('/realms/:realm/authentication/flow-bindings', { + templateUrl : resourceUrl + '/partials/authentication-flow-bindings.html', + resolve : { + realm : function(RealmLoader) { + return RealmLoader(); + }, + flows : function(AuthenticationFlowsLoader) { + return AuthenticationFlowsLoader(); + }, + serverInfo : function(ServerInfo) { + return ServerInfo.delay; + } + }, + controller : 'RealmFlowBindingCtrl' + }) .when('/realms/:realm/authentication/flows/:flow', { templateUrl : resourceUrl + '/partials/authentication-flows.html', resolve : { diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js index 0ed6fa4667..9aeb0e8a73 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js @@ -376,6 +376,7 @@ module.controller('RealmOtpPolicyCtrl', function($scope, Current, Realm, realm, genericRealmUpdate($scope, Current, Realm, realm, serverInfo, $http, $location, Dialog, Notifications, "/realms/" + realm.realm + "/authentication/otp-policy"); }); + module.controller('RealmThemeCtrl', function($scope, Current, Realm, realm, serverInfo, $http, $location, Dialog, Notifications) { genericRealmUpdate($scope, Current, Realm, realm, serverInfo, $http, $location, Dialog, Notifications, "/realms/" + realm.realm + "/theme-settings"); @@ -1620,6 +1621,13 @@ module.controller('IdentityProviderMapperCreateCtrl', function($scope, realm, id }); +module.controller('RealmFlowBindingCtrl', function($scope, flows, Current, Realm, realm, serverInfo, $http, $location, Dialog, Notifications) { + $scope.flows = flows; + + genericRealmUpdate($scope, Current, Realm, realm, serverInfo, $http, $location, Dialog, Notifications, "/realms/" + realm.realm + "/authentication/flow-bindings"); +}); + + module.controller('CreateFlowCtrl', function($scope, realm, AuthenticationFlows, Notifications, $location) { @@ -1770,8 +1778,9 @@ module.controller('AuthenticationFlowsCtrl', function($scope, $route, realm, flo }; $scope.removeFlow = function() { - AuthenticationFlows.remove({realm: realm, flow: flow.id}, function() { - $route.reload(); + console.log('Remove flow:' + $scope.flow.alias); + AuthenticationFlows.remove({realm: realm.realm, flow: $scope.flow.id}, function() { + $location.url("/realms/" + realm.realm + '/authentication/flows'); Notifications.success("Flow removed"); }) diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/authentication-flow-bindings.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/authentication-flow-bindings.html new file mode 100755 index 0000000000..050c5f17fa --- /dev/null +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/authentication-flow-bindings.html @@ -0,0 +1,49 @@ +
+

Authentication

+ + + +
+
+ +
+
+ +
+
+ Select the flow you want to use for browser authentication. +
+
+ +
+
+ +
+
+ Select the flow you want to use for registration. +
+
+ +
+
+ +
+
+ Select the flow you want to use for direct grant authentication. +
+ +
+
+ + +
+
+
+ +
+ + + \ No newline at end of file diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-authentication.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-authentication.html index 214a9ad084..0fcd65a440 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-authentication.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-authentication.html @@ -1,5 +1,6 @@