app.js 140 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858
  1. 'use strict';
  2. var auth = {};
  3. var resourceBundle;
  4. var locale = 'en';
  5. var module = angular.module('keycloak', [ 'keycloak.services', 'keycloak.loaders', 'ui.bootstrap', 'ui.select2', 'angularFileUpload', 'angularTreeview', 'pascalprecht.translate', 'ngCookies', 'ngSanitize', 'ui.ace']);
  6. var resourceRequests = 0;
  7. var loadingTimer = -1;
  8. var translateProvider = null;
  9. var currentRealm = null;
  10. angular.element(document).ready(function () {
  11. var keycloakAuth = new Keycloak(consoleBaseUrl + 'config');
  12. function whoAmI(success, error) {
  13. var req = new XMLHttpRequest();
  14. req.open('GET', consoleBaseUrl + 'whoami', true);
  15. req.setRequestHeader('Accept', 'application/json');
  16. req.setRequestHeader('Authorization', 'bearer ' + keycloakAuth.token);
  17. req.onreadystatechange = function () {
  18. if (req.readyState == 4) {
  19. if (req.status == 200) {
  20. var data = JSON.parse(req.responseText);
  21. success(data);
  22. } else {
  23. error();
  24. }
  25. }
  26. }
  27. req.send();
  28. }
  29. function loadResourceBundle(success, error) {
  30. var req = new XMLHttpRequest();
  31. req.open('GET', consoleBaseUrl + 'messages.json?lang=' + locale, true);
  32. req.setRequestHeader('Accept', 'application/json');
  33. req.onreadystatechange = function () {
  34. if (req.readyState == 4) {
  35. if (req.status == 200) {
  36. var data = JSON.parse(req.responseText);
  37. success && success(data);
  38. } else {
  39. error && error();
  40. }
  41. }
  42. }
  43. req.send();
  44. }
  45. function loadSelect2Localization() {
  46. // 'en' is the built-in default and does not have to be loaded.
  47. var supportedLocales = ['ar', 'az', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'es', 'et', 'eu', 'fa', 'fi', 'fr',
  48. 'gl', 'he', 'hr', 'hu', 'id', 'is', 'it', 'ja', 'ka', 'ko', 'lt', 'lv', 'mk', 'ms', 'nl', 'no', 'pl',
  49. 'pt-BR', 'pt-PT', 'ro', 'rs', 'ru', 'sk', 'sv', 'th', 'tr', 'ug-CN', 'uk', 'vi', 'zh-CN', 'zh-TW'];
  50. if (supportedLocales.indexOf(locale) == -1) return;
  51. var select2JsUrl;
  52. var allScriptElements = document.getElementsByTagName('script');
  53. for (var i = 0, n = allScriptElements.length; i < n; i++) {
  54. var src = allScriptElements[i].getAttribute('src');
  55. if (src && src.match(/\/select2\/select2\.js$/)) {
  56. select2JsUrl = src;
  57. break;
  58. }
  59. }
  60. if (!select2JsUrl) return;
  61. var scriptElement = document.createElement('script');
  62. scriptElement.src = select2JsUrl.replace(/\/select2\/select2\.js$/, '/select2/select2_locale_'+locale+'.js');
  63. scriptElement.type = 'text/javascript';
  64. document.getElementsByTagName('head')[0].appendChild(scriptElement);
  65. }
  66. function hasAnyAccess(user) {
  67. return user && user['realm_access'];
  68. }
  69. keycloakAuth.onAuthLogout = function() {
  70. location.reload();
  71. }
  72. auth.refreshPermissions = function(success, error) {
  73. whoAmI(function(data) {
  74. auth.user = data;
  75. auth.loggedIn = true;
  76. auth.hasAnyAccess = hasAnyAccess(data);
  77. success();
  78. }, function() {
  79. error();
  80. });
  81. };
  82. module.factory('Auth', function () {
  83. return auth;
  84. });
  85. keycloakAuth.init({ onLoad: 'login-required', pkceMethod: 'S256' }).then(function () {
  86. auth.authz = keycloakAuth;
  87. whoAmI(function(data) {
  88. auth.user = data;
  89. auth.loggedIn = true;
  90. auth.hasAnyAccess = hasAnyAccess(data);
  91. locale = auth.user.locale || locale;
  92. loadResourceBundle(function(data) {
  93. resourceBundle = data;
  94. var injector = angular.bootstrap(document, ["keycloak"]);
  95. injector.get('$translate')('consoleTitle').then(function (consoleTitle) {
  96. document.title = consoleTitle;
  97. });
  98. });
  99. });
  100. loadSelect2Localization();
  101. }).catch(function () {
  102. window.location.reload();
  103. });
  104. });
  105. module.factory('authInterceptor', function($q, Auth) {
  106. return {
  107. request: function (config) {
  108. if (!config.url.match(/.html$/)) {
  109. var deferred = $q.defer();
  110. if (Auth.authz.token) {
  111. Auth.authz.updateToken(5).then(function () {
  112. config.headers = config.headers || {};
  113. config.headers.Authorization = 'Bearer ' + Auth.authz.token;
  114. deferred.resolve(config);
  115. }).catch(function () {
  116. location.reload();
  117. });
  118. }
  119. return deferred.promise;
  120. } else {
  121. return config;
  122. }
  123. }
  124. };
  125. });
  126. module.config(['$translateProvider', function($translateProvider) {
  127. translateProvider = $translateProvider;
  128. $translateProvider.useSanitizeValueStrategy('sanitizeParameters');
  129. $translateProvider.preferredLanguage(locale);
  130. $translateProvider.translations(locale, resourceBundle);
  131. }]);
  132. // Change for upgrade to AngularJS 1.6
  133. // See https://github.com/angular/angular.js/commit/aa077e81129c740041438688dff2e8d20c3d7b52
  134. module.config(['$locationProvider', function($locationProvider) {
  135. $locationProvider.hashPrefix('');
  136. }]);
  137. module.config([ '$routeProvider', function($routeProvider) {
  138. $routeProvider
  139. .when('/create/realm', {
  140. templateUrl : resourceUrl + '/partials/realm-create.html',
  141. resolve : {
  142. },
  143. controller : 'RealmCreateCtrl'
  144. })
  145. .when('/realms/:realm', {
  146. templateUrl : resourceUrl + '/partials/realm-detail.html',
  147. resolve : {
  148. realm : function(RealmLoader) {
  149. return RealmLoader();
  150. },
  151. serverInfo : function(ServerInfoLoader) {
  152. return ServerInfoLoader();
  153. }
  154. },
  155. controller : 'RealmDetailCtrl'
  156. })
  157. .when('/realms/:realm/localization', {
  158. templateUrl : resourceUrl + '/partials/realm-localization.html',
  159. resolve : {
  160. realm : function(RealmLoader) {
  161. return RealmLoader();
  162. },
  163. serverInfo : function(ServerInfoLoader) {
  164. return ServerInfoLoader();
  165. },
  166. realmSpecificLocales : function(RealmSpecificLocalesLoader) {
  167. return RealmSpecificLocalesLoader();
  168. }
  169. },
  170. controller : 'RealmLocalizationCtrl'
  171. })
  172. .when('/realms/:realm/localization/upload', {
  173. templateUrl : resourceUrl + '/partials/realm-localization-upload.html',
  174. resolve : {
  175. realm : function(RealmLoader) {
  176. return RealmLoader();
  177. },
  178. serverInfo : function(ServerInfoLoader) {
  179. return ServerInfoLoader();
  180. }
  181. },
  182. controller : 'RealmLocalizationUploadCtrl'
  183. })
  184. .when('/realms/:realm/login-settings', {
  185. templateUrl : resourceUrl + '/partials/realm-login-settings.html',
  186. resolve : {
  187. realm : function(RealmLoader) {
  188. return RealmLoader();
  189. },
  190. serverInfo : function(ServerInfoLoader) {
  191. return ServerInfoLoader();
  192. }
  193. },
  194. controller : 'RealmLoginSettingsCtrl'
  195. })
  196. .when('/realms/:realm/theme-settings', {
  197. templateUrl : resourceUrl + '/partials/realm-theme-settings.html',
  198. resolve : {
  199. realm : function(RealmLoader) {
  200. return RealmLoader();
  201. },
  202. serverInfo : function(ServerInfoLoader) {
  203. return ServerInfoLoader();
  204. }
  205. },
  206. controller : 'RealmThemeCtrl'
  207. })
  208. .when('/realms/:realm/cache-settings', {
  209. templateUrl : resourceUrl + '/partials/realm-cache-settings.html',
  210. resolve : {
  211. realm : function(RealmLoader) {
  212. return RealmLoader();
  213. },
  214. serverInfo : function(ServerInfoLoader) {
  215. return ServerInfoLoader();
  216. }
  217. },
  218. controller : 'RealmCacheCtrl'
  219. })
  220. .when('/realms', {
  221. templateUrl : resourceUrl + '/partials/realm-list.html',
  222. controller : 'RealmListCtrl'
  223. })
  224. .when('/realms/:realm/token-settings', {
  225. templateUrl : resourceUrl + '/partials/realm-tokens.html',
  226. resolve : {
  227. serverInfo : function(ServerInfoLoader) {
  228. return ServerInfoLoader();
  229. },
  230. realm : function(RealmLoader) {
  231. return RealmLoader();
  232. }
  233. },
  234. controller : 'RealmTokenDetailCtrl'
  235. })
  236. .when('/realms/:realm/user-profile', {
  237. templateUrl : resourceUrl + '/partials/realm-user-profile.html',
  238. resolve : {
  239. serverInfo : function(ServerInfoLoader) {
  240. return ServerInfoLoader();
  241. },
  242. realm : function(RealmLoader) {
  243. return RealmLoader();
  244. },
  245. clientScopes : function(ClientScopeListLoader) {
  246. return ClientScopeListLoader();
  247. },
  248. },
  249. controller : 'RealmUserProfileCtrl'
  250. })
  251. .when('/realms/:realm/client-registration/client-initial-access', {
  252. templateUrl : resourceUrl + '/partials/client-initial-access.html',
  253. resolve : {
  254. realm : function(RealmLoader) {
  255. return RealmLoader();
  256. },
  257. clientInitialAccess : function(ClientInitialAccessLoader) {
  258. return ClientInitialAccessLoader();
  259. }
  260. },
  261. controller : 'ClientInitialAccessCtrl'
  262. })
  263. .when('/realms/:realm/client-registration/client-initial-access/create', {
  264. templateUrl : resourceUrl + '/partials/client-initial-access-create.html',
  265. resolve : {
  266. realm : function(RealmLoader) {
  267. return RealmLoader();
  268. }
  269. },
  270. controller : 'ClientInitialAccessCreateCtrl'
  271. })
  272. .when('/realms/:realm/client-registration/client-reg-policies', {
  273. templateUrl : resourceUrl + '/partials/client-reg-policies.html',
  274. resolve : {
  275. realm : function(RealmLoader) {
  276. return RealmLoader();
  277. },
  278. policies : function(ComponentsLoader) {
  279. return ComponentsLoader.loadComponents(null, 'org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy');
  280. },
  281. clientRegistrationPolicyProviders : function(ClientRegistrationPolicyProvidersLoader) {
  282. return ClientRegistrationPolicyProvidersLoader();
  283. }
  284. },
  285. controller : 'ClientRegPoliciesCtrl'
  286. })
  287. .when('/realms/:realm/client-registration/client-reg-policies/create/:componentType/:providerId', {
  288. templateUrl : resourceUrl + '/partials/client-reg-policy-detail.html',
  289. resolve : {
  290. realm : function(RealmLoader) {
  291. return RealmLoader();
  292. },
  293. instance : function($route) {
  294. return {
  295. providerType: 'org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy',
  296. subType: $route.current.params.componentType,
  297. providerId: $route.current.params.providerId
  298. };
  299. },
  300. clientRegistrationPolicyProviders : function(ClientRegistrationPolicyProvidersLoader) {
  301. return ClientRegistrationPolicyProvidersLoader();
  302. }
  303. },
  304. controller : 'ClientRegPolicyDetailCtrl'
  305. })
  306. .when('/realms/:realm/client-registration/client-reg-policies/:provider/:componentId', {
  307. templateUrl : resourceUrl + '/partials/client-reg-policy-detail.html',
  308. resolve : {
  309. realm : function(RealmLoader) {
  310. return RealmLoader();
  311. },
  312. instance : function(ComponentLoader) {
  313. return ComponentLoader();
  314. },
  315. clientRegistrationPolicyProviders : function(ClientRegistrationPolicyProvidersLoader) {
  316. return ClientRegistrationPolicyProvidersLoader();
  317. }
  318. },
  319. controller : 'ClientRegPolicyDetailCtrl'
  320. })
  321. .when('/realms/:realm/client-policies/profiles', {
  322. templateUrl : resourceUrl + '/partials/client-policies-profiles-list.html',
  323. resolve : {
  324. realm : function(RealmLoader) {
  325. return RealmLoader();
  326. },
  327. clientProfiles : function(ClientPoliciesProfilesLoader) {
  328. return ClientPoliciesProfilesLoader.loadClientProfiles('true');
  329. },
  330. },
  331. controller : 'ClientPoliciesProfilesListCtrl'
  332. })
  333. .when('/realms/:realm/client-policies/profiles-json', {
  334. templateUrl : resourceUrl + '/partials/client-policies-profiles-json.html',
  335. resolve : {
  336. realm : function(RealmLoader) {
  337. return RealmLoader();
  338. },
  339. clientProfiles : function(ClientPoliciesProfilesLoader) {
  340. return ClientPoliciesProfilesLoader.loadClientProfiles('true');
  341. }
  342. },
  343. controller : 'ClientPoliciesProfilesJsonCtrl'
  344. })
  345. .when('/realms/:realm/client-policies/profiles-create', {
  346. templateUrl : resourceUrl + '/partials/client-policies-profiles-edit.html',
  347. resolve : {
  348. realm : function(RealmLoader) {
  349. return RealmLoader();
  350. },
  351. clientProfiles : function(ClientPoliciesProfilesLoader) {
  352. return ClientPoliciesProfilesLoader.loadClientProfiles('false');
  353. }
  354. },
  355. controller : 'ClientPoliciesProfilesEditCtrl'
  356. })
  357. .when('/realms/:realm/client-policies/profiles-update/:profileName', {
  358. templateUrl : resourceUrl + '/partials/client-policies-profiles-edit.html',
  359. resolve : {
  360. realm : function(RealmLoader) {
  361. return RealmLoader();
  362. },
  363. clientProfiles : function(ClientPoliciesProfilesLoader) {
  364. return ClientPoliciesProfilesLoader.loadClientProfiles('true');
  365. }
  366. },
  367. controller : 'ClientPoliciesProfilesEditCtrl'
  368. })
  369. .when('/realms/:realm/client-policies/profiles-update/:profileName/create-executor', {
  370. templateUrl : resourceUrl + '/partials/client-policies-profiles-edit-executor.html',
  371. resolve : {
  372. realm : function(RealmLoader) {
  373. return RealmLoader();
  374. },
  375. clientProfiles : function(ClientPoliciesProfilesLoader) {
  376. return ClientPoliciesProfilesLoader.loadClientProfiles('false');
  377. },
  378. serverInfo : function(ServerInfoLoader) {
  379. return ServerInfoLoader();
  380. }
  381. },
  382. controller : 'ClientPoliciesProfilesEditExecutorCtrl'
  383. })
  384. .when('/realms/:realm/client-policies/profiles-update/:profileName/update-executor/:executorIndex', {
  385. templateUrl : resourceUrl + '/partials/client-policies-profiles-edit-executor.html',
  386. resolve : {
  387. realm : function(RealmLoader) {
  388. return RealmLoader();
  389. },
  390. clientProfiles : function(ClientPoliciesProfilesLoader) {
  391. return ClientPoliciesProfilesLoader.loadClientProfiles('true');
  392. },
  393. serverInfo : function(ServerInfoLoader) {
  394. return ServerInfoLoader();
  395. }
  396. },
  397. controller : 'ClientPoliciesProfilesEditExecutorCtrl'
  398. })
  399. .when('/realms/:realm/client-policies/policies', {
  400. templateUrl : resourceUrl + '/partials/client-policies-list.html',
  401. resolve : {
  402. realm : function(RealmLoader) {
  403. return RealmLoader();
  404. },
  405. clientPolicies : function(ClientPoliciesLoader) {
  406. return ClientPoliciesLoader();
  407. }
  408. },
  409. controller : 'ClientPoliciesListCtrl'
  410. })
  411. .when('/realms/:realm/client-policies/policies-json', {
  412. templateUrl : resourceUrl + '/partials/client-policies-json.html',
  413. resolve : {
  414. realm : function(RealmLoader) {
  415. return RealmLoader();
  416. },
  417. clientPolicies : function(ClientPoliciesLoader) {
  418. return ClientPoliciesLoader();
  419. }
  420. },
  421. controller : 'ClientPoliciesJsonCtrl'
  422. })
  423. .when('/realms/:realm/client-policies/policy-create', {
  424. templateUrl : resourceUrl + '/partials/client-policies-policy-edit.html',
  425. resolve : {
  426. realm : function(RealmLoader) {
  427. return RealmLoader();
  428. },
  429. clientProfiles : function(ClientPoliciesProfilesLoader) {
  430. return ClientPoliciesProfilesLoader.loadClientProfiles('true');
  431. },
  432. clientPolicies : function(ClientPoliciesLoader) {
  433. return ClientPoliciesLoader();
  434. }
  435. },
  436. controller : 'ClientPoliciesEditCtrl'
  437. })
  438. .when('/realms/:realm/client-policies/policies-update/:policyName', {
  439. templateUrl : resourceUrl + '/partials/client-policies-policy-edit.html',
  440. resolve : {
  441. realm : function(RealmLoader) {
  442. return RealmLoader();
  443. },
  444. clientProfiles : function(ClientPoliciesProfilesLoader) {
  445. return ClientPoliciesProfilesLoader.loadClientProfiles('true');
  446. },
  447. clientPolicies : function(ClientPoliciesLoader) {
  448. return ClientPoliciesLoader();
  449. }
  450. },
  451. controller : 'ClientPoliciesEditCtrl'
  452. })
  453. .when('/realms/:realm/client-policies/policies-update/:policyName/create-condition', {
  454. templateUrl : resourceUrl + '/partials/client-policies-policy-edit-condition.html',
  455. resolve : {
  456. realm : function(RealmLoader) {
  457. return RealmLoader();
  458. },
  459. clientPolicies : function(ClientPoliciesLoader) {
  460. return ClientPoliciesLoader();
  461. },
  462. serverInfo : function(ServerInfoLoader) {
  463. return ServerInfoLoader();
  464. }
  465. },
  466. controller : 'ClientPoliciesEditConditionCtrl'
  467. })
  468. .when('/realms/:realm/client-policies/policies-update/:policyName/update-condition/:conditionIndex', {
  469. templateUrl : resourceUrl + '/partials/client-policies-policy-edit-condition.html',
  470. resolve : {
  471. realm : function(RealmLoader) {
  472. return RealmLoader();
  473. },
  474. clientPolicies : function(ClientPoliciesLoader) {
  475. return ClientPoliciesLoader();
  476. },
  477. serverInfo : function(ServerInfoLoader) {
  478. return ServerInfoLoader();
  479. }
  480. },
  481. controller : 'ClientPoliciesEditConditionCtrl'
  482. })
  483. .when('/realms/:realm/keys', {
  484. templateUrl : resourceUrl + '/partials/realm-keys.html',
  485. resolve : {
  486. realm : function(RealmLoader) {
  487. return RealmLoader();
  488. },
  489. serverInfo : function(ServerInfoLoader) {
  490. return ServerInfoLoader();
  491. },
  492. keys: function(RealmKeysLoader) {
  493. return RealmKeysLoader();
  494. }
  495. },
  496. controller : 'RealmKeysCtrl'
  497. })
  498. .when('/realms/:realm/keys/passive', {
  499. templateUrl : resourceUrl + '/partials/realm-keys-passive.html',
  500. resolve : {
  501. realm : function(RealmLoader) {
  502. return RealmLoader();
  503. },
  504. serverInfo : function(ServerInfoLoader) {
  505. return ServerInfoLoader();
  506. },
  507. keys: function(RealmKeysLoader) {
  508. return RealmKeysLoader();
  509. }
  510. },
  511. controller : 'RealmKeysCtrl'
  512. })
  513. .when('/realms/:realm/keys/disabled', {
  514. templateUrl : resourceUrl + '/partials/realm-keys-disabled.html',
  515. resolve : {
  516. realm : function(RealmLoader) {
  517. return RealmLoader();
  518. },
  519. serverInfo : function(ServerInfoLoader) {
  520. return ServerInfoLoader();
  521. },
  522. keys: function(RealmKeysLoader) {
  523. return RealmKeysLoader();
  524. }
  525. },
  526. controller : 'RealmKeysCtrl'
  527. })
  528. .when('/realms/:realm/keys/providers', {
  529. templateUrl : resourceUrl + '/partials/realm-keys-providers.html',
  530. resolve : {
  531. realm : function(RealmLoader) {
  532. return RealmLoader();
  533. },
  534. serverInfo : function(ServerInfoLoader) {
  535. return ServerInfoLoader();
  536. }
  537. },
  538. controller : 'RealmKeysProvidersCtrl'
  539. })
  540. .when('/create/keys/:realm/providers/:provider', {
  541. templateUrl : resourceUrl + '/partials/realm-keys-generic.html',
  542. resolve : {
  543. realm : function(RealmLoader) {
  544. return RealmLoader();
  545. },
  546. instance : function() {
  547. return {
  548. };
  549. },
  550. providerId : function($route) {
  551. return $route.current.params.provider;
  552. },
  553. serverInfo : function(ServerInfoLoader) {
  554. return ServerInfoLoader();
  555. }
  556. },
  557. controller : 'GenericKeystoreCtrl'
  558. })
  559. .when('/realms/:realm/keys/providers/:provider/:componentId', {
  560. templateUrl : resourceUrl + '/partials/realm-keys-generic.html',
  561. resolve : {
  562. realm : function(RealmLoader) {
  563. return RealmLoader();
  564. },
  565. instance : function(ComponentLoader) {
  566. return ComponentLoader();
  567. },
  568. providerId : function($route) {
  569. return $route.current.params.provider;
  570. },
  571. serverInfo : function(ServerInfoLoader) {
  572. return ServerInfoLoader();
  573. }
  574. },
  575. controller : 'GenericKeystoreCtrl'
  576. })
  577. .when('/realms/:realm/identity-provider-settings', {
  578. templateUrl : resourceUrl + '/partials/realm-identity-provider.html',
  579. resolve : {
  580. realm : function(RealmLoader) {
  581. return RealmLoader();
  582. },
  583. serverInfo : function(ServerInfoLoader) {
  584. return ServerInfoLoader();
  585. },
  586. instance : function(IdentityProviderLoader) {
  587. return {};
  588. },
  589. providerFactory : function(IdentityProviderFactoryLoader) {
  590. return {};
  591. },
  592. authFlows : function(AuthenticationFlowsLoader) {
  593. return {};
  594. }
  595. },
  596. controller : 'RealmIdentityProviderCtrl'
  597. })
  598. .when('/create/identity-provider/:realm/:provider_id', {
  599. templateUrl : function(params){ return resourceUrl + '/partials/realm-identity-provider-' + params.provider_id + '.html'; },
  600. resolve : {
  601. realm : function(RealmLoader) {
  602. return RealmLoader();
  603. },
  604. serverInfo : function(ServerInfoLoader) {
  605. return ServerInfoLoader();
  606. },
  607. instance : function(IdentityProviderLoader) {
  608. return {};
  609. },
  610. providerFactory : function(IdentityProviderFactoryLoader) {
  611. return new IdentityProviderFactoryLoader();
  612. },
  613. authFlows : function(AuthenticationFlowsLoader) {
  614. return AuthenticationFlowsLoader();
  615. }
  616. },
  617. controller : 'RealmIdentityProviderCtrl'
  618. })
  619. .when('/realms/:realm/identity-provider-settings/provider/:provider_id/:alias', {
  620. templateUrl : function(params){ return resourceUrl + '/partials/realm-identity-provider-' + params.provider_id + '.html'; },
  621. resolve : {
  622. realm : function(RealmLoader) {
  623. return RealmLoader();
  624. },
  625. serverInfo : function(ServerInfoLoader) {
  626. return ServerInfoLoader();
  627. },
  628. instance : function(IdentityProviderLoader) {
  629. return IdentityProviderLoader();
  630. },
  631. providerFactory : function(IdentityProviderFactoryLoader) {
  632. return IdentityProviderFactoryLoader();
  633. },
  634. authFlows : function(AuthenticationFlowsLoader) {
  635. return AuthenticationFlowsLoader();
  636. }
  637. },
  638. controller : 'RealmIdentityProviderCtrl'
  639. })
  640. .when('/realms/:realm/identity-provider-settings/provider/:provider_id/:alias/export', {
  641. templateUrl : resourceUrl + '/partials/realm-identity-provider-export.html',
  642. resolve : {
  643. realm : function(RealmLoader) {
  644. return RealmLoader();
  645. },
  646. serverInfo : function(ServerInfoLoader) {
  647. return ServerInfoLoader();
  648. },
  649. identityProvider : function(IdentityProviderLoader) {
  650. return IdentityProviderLoader();
  651. },
  652. providerFactory : function(IdentityProviderFactoryLoader) {
  653. return IdentityProviderFactoryLoader();
  654. }
  655. },
  656. controller : 'RealmIdentityProviderExportCtrl'
  657. })
  658. .when('/realms/:realm/identity-provider-mappers/:alias/mappers', {
  659. templateUrl : function(params){ return resourceUrl + '/partials/identity-provider-mappers.html'; },
  660. resolve : {
  661. realm : function(RealmLoader) {
  662. return RealmLoader();
  663. },
  664. identityProvider : function(IdentityProviderLoader) {
  665. return IdentityProviderLoader();
  666. },
  667. mapperTypes : function(IdentityProviderMapperTypesLoader) {
  668. return IdentityProviderMapperTypesLoader();
  669. },
  670. mappers : function(IdentityProviderMappersLoader) {
  671. return IdentityProviderMappersLoader();
  672. }
  673. },
  674. controller : 'IdentityProviderMapperListCtrl'
  675. })
  676. .when('/realms/:realm/identity-provider-mappers/:alias/mappers/:mapperId', {
  677. templateUrl : function(params){ return resourceUrl + '/partials/identity-provider-mapper-detail.html'; },
  678. resolve : {
  679. realm : function(RealmLoader) {
  680. return RealmLoader();
  681. },
  682. identityProvider : function(IdentityProviderLoader) {
  683. return IdentityProviderLoader();
  684. },
  685. mapperTypes : function(IdentityProviderMapperTypesLoader) {
  686. return IdentityProviderMapperTypesLoader();
  687. },
  688. mapper : function(IdentityProviderMapperLoader) {
  689. return IdentityProviderMapperLoader();
  690. }
  691. },
  692. controller : 'IdentityProviderMapperCtrl'
  693. })
  694. .when('/create/identity-provider-mappers/:realm/:alias', {
  695. templateUrl : function(params){ return resourceUrl + '/partials/identity-provider-mapper-detail.html'; },
  696. resolve : {
  697. realm : function(RealmLoader) {
  698. return RealmLoader();
  699. },
  700. identityProvider : function(IdentityProviderLoader) {
  701. return IdentityProviderLoader();
  702. },
  703. mapperTypes : function(IdentityProviderMapperTypesLoader) {
  704. return IdentityProviderMapperTypesLoader();
  705. }
  706. },
  707. controller : 'IdentityProviderMapperCreateCtrl'
  708. })
  709. .when('/realms/:realm/default-roles', {
  710. templateUrl : resourceUrl + '/partials/realm-default-roles.html',
  711. resolve : {
  712. realm : function(RealmLoader) {
  713. return RealmLoader();
  714. },
  715. roles : function(RoleListLoader) {
  716. return RoleListLoader();
  717. }
  718. },
  719. controller : 'RealmDefaultRolesCtrl'
  720. })
  721. .when('/realms/:realm/smtp-settings', {
  722. templateUrl : resourceUrl + '/partials/realm-smtp.html',
  723. resolve : {
  724. realm : function(RealmLoader) {
  725. return RealmLoader();
  726. }
  727. },
  728. controller : 'RealmSMTPSettingsCtrl'
  729. })
  730. .when('/realms/:realm/events', {
  731. templateUrl : resourceUrl + '/partials/realm-events.html',
  732. resolve : {
  733. realm : function(RealmLoader) {
  734. return RealmLoader();
  735. },
  736. serverInfo : function(ServerInfoLoader) {
  737. return ServerInfoLoader();
  738. }
  739. },
  740. controller : 'RealmEventsCtrl'
  741. })
  742. .when('/realms/:realm/admin-events', {
  743. templateUrl : resourceUrl + '/partials/realm-events-admin.html',
  744. resolve : {
  745. realm : function(RealmLoader) {
  746. return RealmLoader();
  747. },
  748. serverInfo : function(ServerInfoLoader) {
  749. return ServerInfoLoader();
  750. }
  751. },
  752. controller : 'RealmAdminEventsCtrl'
  753. })
  754. .when('/realms/:realm/events-settings', {
  755. templateUrl : resourceUrl + '/partials/realm-events-config.html',
  756. resolve : {
  757. realm : function(RealmLoader) {
  758. return RealmLoader();
  759. },
  760. serverInfo : function(ServerInfoLoader) {
  761. return ServerInfoLoader();
  762. },
  763. eventsConfig : function(RealmEventsConfigLoader) {
  764. return RealmEventsConfigLoader();
  765. }
  766. },
  767. controller : 'RealmEventsConfigCtrl'
  768. })
  769. .when('/realms/:realm/partial-import', {
  770. templateUrl : resourceUrl + '/partials/partial-import.html',
  771. resolve : {
  772. resourceName : function() { return 'users'},
  773. realm : function(RealmLoader) {
  774. return RealmLoader();
  775. }
  776. },
  777. controller : 'RealmImportCtrl'
  778. })
  779. .when('/realms/:realm/partial-export', {
  780. templateUrl : resourceUrl + '/partials/partial-export.html',
  781. resolve : {
  782. realm : function(RealmLoader) {
  783. return RealmLoader();
  784. }
  785. },
  786. controller : 'RealmExportCtrl'
  787. })
  788. .when('/create/user/:realm', {
  789. templateUrl : resourceUrl + '/partials/user-detail.html',
  790. resolve : {
  791. realm : function(RealmLoader) {
  792. return RealmLoader();
  793. },
  794. user : function() {
  795. return {};
  796. }
  797. },
  798. controller : 'UserDetailCtrl'
  799. })
  800. .when('/realms/:realm/users/:user', {
  801. templateUrl : resourceUrl + '/partials/user-detail.html',
  802. resolve : {
  803. realm : function(RealmLoader) {
  804. return RealmLoader();
  805. },
  806. user : function(UserLoader) {
  807. return UserLoader();
  808. }
  809. },
  810. controller : 'UserDetailCtrl'
  811. })
  812. .when('/realms/:realm/users/:user/user-attributes', {
  813. templateUrl : resourceUrl + '/partials/user-attributes.html',
  814. resolve : {
  815. realm : function(RealmLoader) {
  816. return RealmLoader();
  817. },
  818. user : function(UserLoader) {
  819. return UserLoader();
  820. }
  821. },
  822. controller : 'UserDetailCtrl'
  823. })
  824. .when('/realms/:realm/users/:user/user-credentials', {
  825. templateUrl : resourceUrl + '/partials/user-credentials.html',
  826. resolve : {
  827. realm : function(RealmLoader) {
  828. return RealmLoader();
  829. },
  830. user : function(UserLoader) {
  831. return UserLoader();
  832. }
  833. },
  834. controller : 'UserCredentialsCtrl'
  835. })
  836. .when('/realms/:realm/users/:user/role-mappings', {
  837. templateUrl : resourceUrl + '/partials/role-mappings.html',
  838. resolve : {
  839. realm : function(RealmLoader) {
  840. return RealmLoader();
  841. },
  842. user : function(UserLoader) {
  843. return UserLoader();
  844. },
  845. clients : function(ClientListLoader) {
  846. return ClientListLoader();
  847. },
  848. client : function() {
  849. return {};
  850. }
  851. },
  852. controller : 'UserRoleMappingCtrl'
  853. })
  854. .when('/realms/:realm/users/:user/groups', {
  855. templateUrl : resourceUrl + '/partials/user-group-membership.html',
  856. resolve : {
  857. realm : function(RealmLoader) {
  858. return RealmLoader();
  859. },
  860. user : function(UserLoader) {
  861. return UserLoader();
  862. }
  863. },
  864. controller : 'UserGroupMembershipCtrl'
  865. })
  866. .when('/realms/:realm/users/:user/sessions', {
  867. templateUrl : resourceUrl + '/partials/user-sessions.html',
  868. resolve : {
  869. realm : function(RealmLoader) {
  870. return RealmLoader();
  871. },
  872. user : function(UserLoader) {
  873. return UserLoader();
  874. },
  875. sessions : function(UserSessionsLoader) {
  876. return UserSessionsLoader();
  877. }
  878. },
  879. controller : 'UserSessionsCtrl'
  880. })
  881. .when('/realms/:realm/users/:user/federated-identity', {
  882. templateUrl : resourceUrl + '/partials/user-federated-identity-list.html',
  883. resolve : {
  884. realm : function(RealmLoader) {
  885. return RealmLoader();
  886. },
  887. user : function(UserLoader) {
  888. return UserLoader();
  889. },
  890. federatedIdentities : function(UserFederatedIdentityLoader) {
  891. return UserFederatedIdentityLoader();
  892. }
  893. },
  894. controller : 'UserFederatedIdentityCtrl'
  895. })
  896. .when('/create/federated-identity/:realm/:user', {
  897. templateUrl : resourceUrl + '/partials/user-federated-identity-detail.html',
  898. resolve : {
  899. realm : function(RealmLoader) {
  900. return RealmLoader();
  901. },
  902. user : function(UserLoader) {
  903. return UserLoader();
  904. },
  905. federatedIdentities : function(UserFederatedIdentityLoader) {
  906. return UserFederatedIdentityLoader();
  907. }
  908. },
  909. controller : 'UserFederatedIdentityAddCtrl'
  910. })
  911. .when('/realms/:realm/users/:user/consents', {
  912. templateUrl : resourceUrl + '/partials/user-consents.html',
  913. resolve : {
  914. realm : function(RealmLoader) {
  915. return RealmLoader();
  916. },
  917. user : function(UserLoader) {
  918. return UserLoader();
  919. },
  920. userConsents : function(UserConsentsLoader) {
  921. return UserConsentsLoader();
  922. }
  923. },
  924. controller : 'UserConsentsCtrl'
  925. })
  926. .when('/realms/:realm/users/:user/offline-sessions/:client', {
  927. templateUrl : resourceUrl + '/partials/user-offline-sessions.html',
  928. resolve : {
  929. realm : function(RealmLoader) {
  930. return RealmLoader();
  931. },
  932. user : function(UserLoader) {
  933. return UserLoader();
  934. },
  935. client : function(ClientLoader) {
  936. return ClientLoader();
  937. },
  938. offlineSessions : function(UserOfflineSessionsLoader) {
  939. return UserOfflineSessionsLoader();
  940. }
  941. },
  942. controller : 'UserOfflineSessionsCtrl'
  943. })
  944. .when('/realms/:realm/users', {
  945. templateUrl : resourceUrl + '/partials/user-list.html',
  946. resolve : {
  947. realm : function(RealmLoader) {
  948. return RealmLoader();
  949. }
  950. },
  951. controller : 'UserListCtrl'
  952. })
  953. .when('/create/role/:realm', {
  954. templateUrl : resourceUrl + '/partials/role-detail.html',
  955. resolve : {
  956. realm : function(RealmLoader) {
  957. return RealmLoader();
  958. },
  959. role : function() {
  960. return {};
  961. },
  962. roles : function(RoleListLoader) {
  963. return RoleListLoader();
  964. },
  965. clients : function(ClientListLoader) {
  966. return ClientListLoader();
  967. }
  968. },
  969. controller : 'RoleDetailCtrl'
  970. })
  971. .when('/realms/:realm/roles/:role', {
  972. templateUrl : resourceUrl + '/partials/role-detail.html',
  973. resolve : {
  974. realm : function(RealmLoader) {
  975. return RealmLoader();
  976. },
  977. role : function(RoleLoader) {
  978. return RoleLoader();
  979. },
  980. roles : function(RoleListLoader) {
  981. return RoleListLoader();
  982. },
  983. clients : function(ClientListLoader) {
  984. return ClientListLoader();
  985. }
  986. },
  987. controller : 'RoleDetailCtrl'
  988. })
  989. .when('/realms/:realm/roles/:role/role-attributes', {
  990. templateUrl : resourceUrl + '/partials/role-attributes.html',
  991. resolve : {
  992. realm : function(RealmLoader) {
  993. return RealmLoader();
  994. },
  995. role : function(RoleLoader) {
  996. return RoleLoader();
  997. },
  998. roles : function(RoleListLoader) {
  999. return RoleListLoader();
  1000. },
  1001. clients : function(ClientListLoader) {
  1002. return ClientListLoader();
  1003. }
  1004. },
  1005. controller : 'RoleDetailCtrl'
  1006. })
  1007. .when('/realms/:realm/roles/:role/users', {
  1008. templateUrl : resourceUrl + '/partials/realm-role-users.html',
  1009. resolve : {
  1010. realm : function(RealmLoader) {
  1011. return RealmLoader();
  1012. },
  1013. role : function(RoleLoader) {
  1014. return RoleLoader();
  1015. }
  1016. },
  1017. controller : 'RoleMembersCtrl'
  1018. })
  1019. .when('/realms/:realm/roles', {
  1020. templateUrl : resourceUrl + '/partials/role-list.html',
  1021. resolve : {
  1022. realm : function(RealmLoader) {
  1023. return RealmLoader();
  1024. }
  1025. },
  1026. controller : 'RoleListCtrl'
  1027. })
  1028. .when('/realms/:realm/groups', {
  1029. templateUrl : resourceUrl + '/partials/group-list.html',
  1030. resolve : {
  1031. realm : function(RealmLoader) {
  1032. return RealmLoader();
  1033. }
  1034. },
  1035. controller : 'GroupListCtrl'
  1036. })
  1037. .when('/create/group/:realm/parent/:parentId', {
  1038. templateUrl : resourceUrl + '/partials/create-group.html',
  1039. resolve : {
  1040. realm : function(RealmLoader) {
  1041. return RealmLoader();
  1042. },
  1043. parentId : function($route) {
  1044. return $route.current.params.parentId;
  1045. }
  1046. },
  1047. controller : 'GroupCreateCtrl'
  1048. })
  1049. .when('/realms/:realm/groups/:group', {
  1050. templateUrl : resourceUrl + '/partials/group-detail.html',
  1051. resolve : {
  1052. realm : function(RealmLoader) {
  1053. return RealmLoader();
  1054. },
  1055. group : function(GroupLoader) {
  1056. return GroupLoader();
  1057. }
  1058. },
  1059. controller : 'GroupDetailCtrl'
  1060. })
  1061. .when('/realms/:realm/groups/:group/attributes', {
  1062. templateUrl : resourceUrl + '/partials/group-attributes.html',
  1063. resolve : {
  1064. realm : function(RealmLoader) {
  1065. return RealmLoader();
  1066. },
  1067. group : function(GroupLoader) {
  1068. return GroupLoader();
  1069. }
  1070. },
  1071. controller : 'GroupDetailCtrl'
  1072. })
  1073. .when('/realms/:realm/groups/:group/members', {
  1074. templateUrl : resourceUrl + '/partials/group-members.html',
  1075. resolve : {
  1076. realm : function(RealmLoader) {
  1077. return RealmLoader();
  1078. },
  1079. group : function(GroupLoader) {
  1080. return GroupLoader();
  1081. }
  1082. },
  1083. controller : 'GroupMembersCtrl'
  1084. })
  1085. .when('/realms/:realm/groups/:group/role-mappings', {
  1086. templateUrl : resourceUrl + '/partials/group-role-mappings.html',
  1087. resolve : {
  1088. realm : function(RealmLoader) {
  1089. return RealmLoader();
  1090. },
  1091. group : function(GroupLoader) {
  1092. return GroupLoader();
  1093. },
  1094. clients : function(ClientListLoader) {
  1095. return ClientListLoader();
  1096. },
  1097. client : function() {
  1098. return {};
  1099. }
  1100. },
  1101. controller : 'GroupRoleMappingCtrl'
  1102. })
  1103. .when('/realms/:realm/default-groups', {
  1104. templateUrl : resourceUrl + '/partials/default-groups.html',
  1105. resolve : {
  1106. realm : function(RealmLoader) {
  1107. return RealmLoader();
  1108. }
  1109. },
  1110. controller : 'DefaultGroupsCtrl'
  1111. })
  1112. .when('/create/role/:realm/clients/:client', {
  1113. templateUrl : resourceUrl + '/partials/client-role-detail.html',
  1114. resolve : {
  1115. realm : function(RealmLoader) {
  1116. return RealmLoader();
  1117. },
  1118. client : function(ClientLoader) {
  1119. return ClientLoader();
  1120. },
  1121. role : function() {
  1122. return {};
  1123. },
  1124. roles : function(RoleListLoader) {
  1125. return RoleListLoader();
  1126. },
  1127. clients : function(ClientListLoader) {
  1128. return ClientListLoader();
  1129. }
  1130. },
  1131. controller : 'ClientRoleDetailCtrl'
  1132. })
  1133. .when('/realms/:realm/clients/:client/roles/:role', {
  1134. templateUrl : resourceUrl + '/partials/client-role-detail.html',
  1135. resolve : {
  1136. realm : function(RealmLoader) {
  1137. return RealmLoader();
  1138. },
  1139. client : function(ClientLoader) {
  1140. return ClientLoader();
  1141. },
  1142. role : function(ClientRoleLoader) {
  1143. return ClientRoleLoader();
  1144. },
  1145. roles : function(RoleListLoader) {
  1146. return RoleListLoader();
  1147. },
  1148. clients : function(ClientListLoader) {
  1149. return ClientListLoader();
  1150. }
  1151. },
  1152. controller : 'ClientRoleDetailCtrl'
  1153. })
  1154. .when('/realms/:realm/clients/:client/roles/:role/role-attributes', {
  1155. templateUrl : resourceUrl + '/partials/client-role-attributes.html',
  1156. resolve : {
  1157. realm : function(RealmLoader) {
  1158. return RealmLoader();
  1159. },
  1160. client : function(ClientLoader) {
  1161. return ClientLoader();
  1162. },
  1163. role : function(ClientRoleLoader) {
  1164. return ClientRoleLoader();
  1165. },
  1166. roles : function(RoleListLoader) {
  1167. return RoleListLoader();
  1168. },
  1169. clients : function(ClientListLoader) {
  1170. return ClientListLoader();
  1171. }
  1172. },
  1173. controller : 'ClientRoleDetailCtrl'
  1174. })
  1175. .when('/realms/:realm/clients/:client/roles/:role/users', {
  1176. templateUrl : resourceUrl + '/partials/client-role-users.html',
  1177. resolve : {
  1178. realm : function(RealmLoader) {
  1179. return RealmLoader();
  1180. },
  1181. client : function(ClientLoader) {
  1182. return ClientLoader();
  1183. },
  1184. role : function(ClientRoleLoader) {
  1185. return ClientRoleLoader();
  1186. }
  1187. },
  1188. controller : 'ClientRoleMembersCtrl'
  1189. })
  1190. .when('/realms/:realm/clients/:client/mappers', {
  1191. templateUrl : resourceUrl + '/partials/client-mappers.html',
  1192. resolve : {
  1193. realm : function(RealmLoader) {
  1194. return RealmLoader();
  1195. },
  1196. client : function(ClientLoader) {
  1197. return ClientLoader();
  1198. },
  1199. serverInfo : function(ServerInfoLoader) {
  1200. return ServerInfoLoader();
  1201. }
  1202. },
  1203. controller : 'ClientProtocolMapperListCtrl'
  1204. })
  1205. .when('/realms/:realm/clients/:client/add-mappers', {
  1206. templateUrl : resourceUrl + '/partials/client-mappers-add.html',
  1207. resolve : {
  1208. realm : function(RealmLoader) {
  1209. return RealmLoader();
  1210. },
  1211. client : function(ClientLoader) {
  1212. return ClientLoader();
  1213. },
  1214. serverInfo : function(ServerInfoLoader) {
  1215. return ServerInfoLoader();
  1216. }
  1217. },
  1218. controller : 'AddBuiltinProtocolMapperCtrl'
  1219. })
  1220. .when('/realms/:realm/clients/:client/mappers/:id', {
  1221. templateUrl : resourceUrl + '/partials/client-protocol-mapper-detail.html',
  1222. resolve : {
  1223. realm : function(RealmLoader) {
  1224. return RealmLoader();
  1225. },
  1226. client : function(ClientLoader) {
  1227. return ClientLoader();
  1228. },
  1229. serverInfo : function(ServerInfoLoader) {
  1230. return ServerInfoLoader();
  1231. },
  1232. mapper : function(ClientProtocolMapperLoader) {
  1233. return ClientProtocolMapperLoader();
  1234. },
  1235. clients : function(ClientListLoader) {
  1236. return ClientListLoader();
  1237. }
  1238. },
  1239. controller : 'ClientProtocolMapperCtrl'
  1240. })
  1241. .when('/create/client/:realm/:client/mappers', {
  1242. templateUrl : resourceUrl + '/partials/client-protocol-mapper-detail.html',
  1243. resolve : {
  1244. realm : function(RealmLoader) {
  1245. return RealmLoader();
  1246. },
  1247. serverInfo : function(ServerInfoLoader) {
  1248. return ServerInfoLoader();
  1249. },
  1250. client : function(ClientLoader) {
  1251. return ClientLoader();
  1252. },
  1253. clients : function(ClientListLoader) {
  1254. return ClientListLoader();
  1255. }
  1256. },
  1257. controller : 'ClientProtocolMapperCreateCtrl'
  1258. })
  1259. .when('/realms/:realm/clients/:client/client-scopes/setup-scopes', {
  1260. templateUrl : resourceUrl + '/partials/client-scopes-setup.html',
  1261. resolve : {
  1262. realm : function(RealmLoader) {
  1263. return RealmLoader();
  1264. },
  1265. client : function(ClientLoader) {
  1266. return ClientLoader();
  1267. },
  1268. clientScopes : function(ClientScopeListLoader) {
  1269. return ClientScopeListLoader();
  1270. },
  1271. serverInfo : function(ServerInfoLoader) {
  1272. return ServerInfoLoader();
  1273. },
  1274. clientDefaultClientScopes : function(ClientDefaultClientScopesLoader) {
  1275. return ClientDefaultClientScopesLoader();
  1276. },
  1277. clientOptionalClientScopes : function(ClientOptionalClientScopesLoader) {
  1278. return ClientOptionalClientScopesLoader();
  1279. }
  1280. },
  1281. controller : 'ClientClientScopesSetupCtrl'
  1282. })
  1283. .when('/realms/:realm/clients/:client/client-scopes/evaluate-scopes', {
  1284. templateUrl : resourceUrl + '/partials/client-scopes-evaluate.html',
  1285. resolve : {
  1286. realm : function(RealmLoader) {
  1287. return RealmLoader();
  1288. },
  1289. client : function(ClientLoader) {
  1290. return ClientLoader();
  1291. },
  1292. clients : function(ClientListLoader) {
  1293. return ClientListLoader();
  1294. },
  1295. clientScopes : function(ClientScopeListLoader) {
  1296. return ClientScopeListLoader();
  1297. },
  1298. clientDefaultClientScopes : function(ClientDefaultClientScopesLoader) {
  1299. return ClientDefaultClientScopesLoader();
  1300. },
  1301. clientOptionalClientScopes : function(ClientOptionalClientScopesLoader) {
  1302. return ClientOptionalClientScopesLoader();
  1303. },
  1304. serverInfo : function(ServerInfoLoader) {
  1305. return ServerInfoLoader();
  1306. }
  1307. },
  1308. controller : 'ClientClientScopesEvaluateCtrl'
  1309. })
  1310. .when('/realms/:realm/client-scopes/:clientScope/mappers', {
  1311. templateUrl : resourceUrl + '/partials/client-scope-mappers.html',
  1312. resolve : {
  1313. realm : function(RealmLoader) {
  1314. return RealmLoader();
  1315. },
  1316. clientScope : function(ClientScopeLoader) {
  1317. return ClientScopeLoader();
  1318. },
  1319. serverInfo : function(ServerInfoLoader) {
  1320. return ServerInfoLoader();
  1321. }
  1322. },
  1323. controller : 'ClientScopeProtocolMapperListCtrl'
  1324. })
  1325. .when('/realms/:realm/client-scopes/:clientScope/add-mappers', {
  1326. templateUrl : resourceUrl + '/partials/client-scope-mappers-add.html',
  1327. resolve : {
  1328. realm : function(RealmLoader) {
  1329. return RealmLoader();
  1330. },
  1331. clientScope : function(ClientScopeLoader) {
  1332. return ClientScopeLoader();
  1333. },
  1334. serverInfo : function(ServerInfoLoader) {
  1335. return ServerInfoLoader();
  1336. }
  1337. },
  1338. controller : 'ClientScopeAddBuiltinProtocolMapperCtrl'
  1339. })
  1340. .when('/realms/:realm/client-scopes/:clientScope/mappers/:id', {
  1341. templateUrl : resourceUrl + '/partials/client-scope-protocol-mapper-detail.html',
  1342. resolve : {
  1343. realm : function(RealmLoader) {
  1344. return RealmLoader();
  1345. },
  1346. clientScope : function(ClientScopeLoader) {
  1347. return ClientScopeLoader();
  1348. },
  1349. serverInfo : function(ServerInfoLoader) {
  1350. return ServerInfoLoader();
  1351. },
  1352. mapper : function(ClientScopeProtocolMapperLoader) {
  1353. return ClientScopeProtocolMapperLoader();
  1354. },
  1355. clients : function(ClientListLoader) {
  1356. return ClientListLoader();
  1357. }
  1358. },
  1359. controller : 'ClientScopeProtocolMapperCtrl'
  1360. })
  1361. .when('/create/client-scope/:realm/:clientScope/mappers', {
  1362. templateUrl : resourceUrl + '/partials/client-scope-protocol-mapper-detail.html',
  1363. resolve : {
  1364. realm : function(RealmLoader) {
  1365. return RealmLoader();
  1366. },
  1367. serverInfo : function(ServerInfoLoader) {
  1368. return ServerInfoLoader();
  1369. },
  1370. clientScope : function(ClientScopeLoader) {
  1371. return ClientScopeLoader();
  1372. },
  1373. clients : function(ClientListLoader) {
  1374. return ClientListLoader();
  1375. }
  1376. },
  1377. controller : 'ClientScopeProtocolMapperCreateCtrl'
  1378. })
  1379. .when('/realms/:realm/clients/:client/sessions', {
  1380. templateUrl : resourceUrl + '/partials/client-sessions.html',
  1381. resolve : {
  1382. realm : function(RealmLoader) {
  1383. return RealmLoader();
  1384. },
  1385. client : function(ClientLoader) {
  1386. return ClientLoader();
  1387. },
  1388. sessionCount : function(ClientSessionCountLoader) {
  1389. return ClientSessionCountLoader();
  1390. }
  1391. },
  1392. controller : 'ClientSessionsCtrl'
  1393. })
  1394. .when('/realms/:realm/clients/:client/offline-access', {
  1395. templateUrl : resourceUrl + '/partials/client-offline-sessions.html',
  1396. resolve : {
  1397. realm : function(RealmLoader) {
  1398. return RealmLoader();
  1399. },
  1400. client : function(ClientLoader) {
  1401. return ClientLoader();
  1402. },
  1403. offlineSessionCount : function(ClientOfflineSessionCountLoader) {
  1404. return ClientOfflineSessionCountLoader();
  1405. }
  1406. },
  1407. controller : 'ClientOfflineSessionsCtrl'
  1408. })
  1409. .when('/realms/:realm/clients/:client/credentials', {
  1410. templateUrl : resourceUrl + '/partials/client-credentials.html',
  1411. resolve : {
  1412. realm : function(RealmLoader) {
  1413. return RealmLoader();
  1414. },
  1415. client : function(ClientLoader) {
  1416. return ClientLoader();
  1417. },
  1418. clientAuthenticatorProviders : function(ClientAuthenticatorProvidersLoader) {
  1419. return ClientAuthenticatorProvidersLoader();
  1420. },
  1421. clientConfigProperties: function(PerClientAuthenticationConfigDescriptionLoader) {
  1422. return PerClientAuthenticationConfigDescriptionLoader();
  1423. }
  1424. },
  1425. controller : 'ClientCredentialsCtrl'
  1426. })
  1427. .when('/realms/:realm/clients/:client/oidc/:keyType/import/:attribute', {
  1428. templateUrl : resourceUrl + '/partials/client-oidc-key-import.html',
  1429. resolve : {
  1430. realm : function(RealmLoader) {
  1431. return RealmLoader();
  1432. },
  1433. client : function(ClientLoader) {
  1434. return ClientLoader();
  1435. },
  1436. callingContext : function() {
  1437. return "oidc";
  1438. }
  1439. },
  1440. controller : 'ClientCertificateImportCtrl'
  1441. })
  1442. .when('/realms/:realm/clients/:client/oidc/:keyType/export/:attribute', {
  1443. templateUrl : resourceUrl + '/partials/client-oidc-key-export.html',
  1444. resolve : {
  1445. realm : function(RealmLoader) {
  1446. return RealmLoader();
  1447. },
  1448. client : function(ClientLoader) {
  1449. return ClientLoader();
  1450. },
  1451. callingContext : function() {
  1452. return "oidc";
  1453. }
  1454. },
  1455. controller : 'ClientCertificateExportCtrl'
  1456. })
  1457. .when('/realms/:realm/clients/:client/identity-provider', {
  1458. templateUrl : resourceUrl + '/partials/client-identity-provider.html',
  1459. resolve : {
  1460. realm : function(RealmLoader) {
  1461. return RealmLoader();
  1462. },
  1463. client : function(ClientLoader) {
  1464. return ClientLoader();
  1465. }
  1466. },
  1467. controller : 'ClientIdentityProviderCtrl'
  1468. })
  1469. .when('/realms/:realm/clients/:client/clustering', {
  1470. templateUrl : resourceUrl + '/partials/client-clustering.html',
  1471. resolve : {
  1472. realm : function(RealmLoader) {
  1473. return RealmLoader();
  1474. },
  1475. client : function(ClientLoader) {
  1476. return ClientLoader();
  1477. }
  1478. },
  1479. controller : 'ClientClusteringCtrl'
  1480. })
  1481. .when('/register-node/realms/:realm/clients/:client/clustering', {
  1482. templateUrl : resourceUrl + '/partials/client-clustering-node.html',
  1483. resolve : {
  1484. realm : function(RealmLoader) {
  1485. return RealmLoader();
  1486. },
  1487. client : function(ClientLoader) {
  1488. return ClientLoader();
  1489. }
  1490. },
  1491. controller : 'ClientClusteringNodeCtrl'
  1492. })
  1493. .when('/realms/:realm/clients/:client/clustering/:node', {
  1494. templateUrl : resourceUrl + '/partials/client-clustering-node.html',
  1495. resolve : {
  1496. realm : function(RealmLoader) {
  1497. return RealmLoader();
  1498. },
  1499. client : function(ClientLoader) {
  1500. return ClientLoader();
  1501. }
  1502. },
  1503. controller : 'ClientClusteringNodeCtrl'
  1504. })
  1505. .when('/realms/:realm/clients/:client/saml/keys', {
  1506. templateUrl : resourceUrl + '/partials/client-saml-keys.html',
  1507. resolve : {
  1508. realm : function(RealmLoader) {
  1509. return RealmLoader();
  1510. },
  1511. client : function(ClientLoader) {
  1512. return ClientLoader();
  1513. }
  1514. },
  1515. controller : 'ClientSamlKeyCtrl'
  1516. })
  1517. .when('/realms/:realm/clients/:client/saml/:keyType/import/:attribute', {
  1518. templateUrl : resourceUrl + '/partials/client-saml-key-import.html',
  1519. resolve : {
  1520. realm : function(RealmLoader) {
  1521. return RealmLoader();
  1522. },
  1523. client : function(ClientLoader) {
  1524. return ClientLoader();
  1525. },
  1526. callingContext : function() {
  1527. return "saml";
  1528. }
  1529. },
  1530. controller : 'ClientCertificateImportCtrl'
  1531. })
  1532. .when('/realms/:realm/clients/:client/saml/:keyType/export/:attribute', {
  1533. templateUrl : resourceUrl + '/partials/client-saml-key-export.html',
  1534. resolve : {
  1535. realm : function(RealmLoader) {
  1536. return RealmLoader();
  1537. },
  1538. client : function(ClientLoader) {
  1539. return ClientLoader();
  1540. },
  1541. callingContext : function() {
  1542. return "saml";
  1543. }
  1544. },
  1545. controller : 'ClientCertificateExportCtrl'
  1546. })
  1547. .when('/realms/:realm/clients/:client/oidc/keys', {
  1548. templateUrl : resourceUrl + '/partials/client-oidc-keys.html',
  1549. resolve : {
  1550. realm : function(RealmLoader) {
  1551. return RealmLoader();
  1552. },
  1553. client : function(ClientLoader) {
  1554. return ClientLoader();
  1555. }
  1556. },
  1557. controller : 'ClientOidcKeyCtrl'
  1558. })
  1559. .when('/realms/:realm/clients/:client/roles', {
  1560. templateUrl : resourceUrl + '/partials/client-role-list.html',
  1561. resolve : {
  1562. realm : function(RealmLoader) {
  1563. return RealmLoader();
  1564. },
  1565. client : function(ClientLoader) {
  1566. return ClientLoader();
  1567. }
  1568. },
  1569. controller : 'ClientRoleListCtrl'
  1570. })
  1571. .when('/realms/:realm/clients/:client/revocation', {
  1572. templateUrl : resourceUrl + '/partials/client-revocation.html',
  1573. resolve : {
  1574. realm : function(RealmLoader) {
  1575. return RealmLoader();
  1576. },
  1577. client : function(ClientLoader) {
  1578. return ClientLoader();
  1579. }
  1580. },
  1581. controller : 'ClientRevocationCtrl'
  1582. })
  1583. .when('/realms/:realm/clients/:client/scope-mappings', {
  1584. templateUrl : resourceUrl + '/partials/client-scope-mappings.html',
  1585. resolve : {
  1586. realm : function(RealmLoader) {
  1587. return RealmLoader();
  1588. },
  1589. client : function(ClientLoader) {
  1590. return ClientLoader();
  1591. },
  1592. clients : function(ClientListLoader) {
  1593. return ClientListLoader();
  1594. }
  1595. },
  1596. controller : 'ClientScopeMappingCtrl'
  1597. })
  1598. .when('/realms/:realm/clients/:client/installation', {
  1599. templateUrl : resourceUrl + '/partials/client-installation.html',
  1600. resolve : {
  1601. realm : function(RealmLoader) {
  1602. return RealmLoader();
  1603. },
  1604. client : function(ClientLoader) {
  1605. return ClientLoader();
  1606. },
  1607. serverInfo : function(ServerInfoLoader) {
  1608. return ServerInfoLoader();
  1609. }
  1610. },
  1611. controller : 'ClientInstallationCtrl'
  1612. })
  1613. .when('/realms/:realm/clients/:client/service-account-roles', {
  1614. templateUrl : resourceUrl + '/partials/client-service-account-roles.html',
  1615. resolve : {
  1616. realm : function(RealmLoader) {
  1617. return RealmLoader();
  1618. },
  1619. user : function(ClientServiceAccountUserLoader) {
  1620. return ClientServiceAccountUserLoader();
  1621. },
  1622. clients : function(ClientListLoader) {
  1623. return ClientListLoader();
  1624. },
  1625. client : function(ClientLoader) {
  1626. return ClientLoader();
  1627. }
  1628. },
  1629. controller : 'UserRoleMappingCtrl'
  1630. })
  1631. .when('/create/client/:realm', {
  1632. templateUrl : resourceUrl + '/partials/create-client.html',
  1633. resolve : {
  1634. realm : function(RealmLoader) {
  1635. return RealmLoader();
  1636. },
  1637. clients : function(ClientListLoader) {
  1638. return ClientListLoader();
  1639. },
  1640. client : function() {
  1641. return {};
  1642. },
  1643. flows : function(AuthenticationFlowsLoader) {
  1644. return AuthenticationFlowsLoader();
  1645. },
  1646. serverInfo : function(ServerInfoLoader) {
  1647. return ServerInfoLoader();
  1648. }
  1649. },
  1650. controller : 'CreateClientCtrl'
  1651. })
  1652. .when('/realms/:realm/clients/:client', {
  1653. templateUrl : resourceUrl + '/partials/client-detail.html',
  1654. resolve : {
  1655. realm : function(RealmLoader) {
  1656. return RealmLoader();
  1657. },
  1658. clients : function(ClientListLoader) {
  1659. return ClientListLoader();
  1660. },
  1661. client : function(ClientLoader) {
  1662. return ClientLoader();
  1663. },
  1664. flows : function(AuthenticationFlowsLoader) {
  1665. return AuthenticationFlowsLoader();
  1666. },
  1667. serverInfo : function(ServerInfoLoader) {
  1668. return ServerInfoLoader();
  1669. }
  1670. },
  1671. controller : 'ClientDetailCtrl'
  1672. })
  1673. .when('/create/client-scope/:realm', {
  1674. templateUrl : resourceUrl + '/partials/client-scope-detail.html',
  1675. resolve : {
  1676. realm : function(RealmLoader) {
  1677. return RealmLoader();
  1678. },
  1679. clientScope : function() {
  1680. return {};
  1681. },
  1682. serverInfo : function(ServerInfoLoader) {
  1683. return ServerInfoLoader();
  1684. }
  1685. },
  1686. controller : 'ClientScopeDetailCtrl'
  1687. })
  1688. .when('/realms/:realm/client-scopes/:clientScope', {
  1689. templateUrl : resourceUrl + '/partials/client-scope-detail.html',
  1690. resolve : {
  1691. realm : function(RealmLoader) {
  1692. return RealmLoader();
  1693. },
  1694. clientScope : function(ClientScopeLoader) {
  1695. return ClientScopeLoader();
  1696. },
  1697. serverInfo : function(ServerInfoLoader) {
  1698. return ServerInfoLoader();
  1699. }
  1700. },
  1701. controller : 'ClientScopeDetailCtrl'
  1702. })
  1703. .when('/realms/:realm/client-scopes/:clientScope/scope-mappings', {
  1704. templateUrl : resourceUrl + '/partials/client-scope-scope-mappings.html',
  1705. resolve : {
  1706. realm : function(RealmLoader) {
  1707. return RealmLoader();
  1708. },
  1709. clientScope : function(ClientScopeLoader) {
  1710. return ClientScopeLoader();
  1711. },
  1712. clients : function(ClientListLoader) {
  1713. return ClientListLoader();
  1714. }
  1715. },
  1716. controller : 'ClientScopeScopeMappingCtrl'
  1717. })
  1718. .when('/realms/:realm/clients', {
  1719. templateUrl : resourceUrl + '/partials/client-list.html',
  1720. resolve : {
  1721. realm : function(RealmLoader) {
  1722. return RealmLoader();
  1723. },
  1724. serverInfo : function(ServerInfoLoader) {
  1725. return ServerInfoLoader();
  1726. }
  1727. },
  1728. controller : 'ClientListCtrl'
  1729. })
  1730. .when('/realms/:realm/client-scopes', {
  1731. templateUrl : resourceUrl + '/partials/client-scope-list.html',
  1732. resolve : {
  1733. realm : function(RealmLoader) {
  1734. return RealmLoader();
  1735. },
  1736. clientScopes : function(ClientScopeListLoader) {
  1737. return ClientScopeListLoader();
  1738. },
  1739. serverInfo : function(ServerInfoLoader) {
  1740. return ServerInfoLoader();
  1741. }
  1742. },
  1743. controller : 'ClientScopeListCtrl'
  1744. })
  1745. .when('/realms/:realm/default-client-scopes', {
  1746. templateUrl : resourceUrl + '/partials/client-scopes-realm-default.html',
  1747. resolve : {
  1748. realm : function(RealmLoader) {
  1749. return RealmLoader();
  1750. },
  1751. clientScopes : function(ClientScopeListLoader) {
  1752. return ClientScopeListLoader();
  1753. },
  1754. serverInfo : function(ServerInfoLoader) {
  1755. return ServerInfoLoader();
  1756. },
  1757. realmDefaultClientScopes : function(RealmDefaultClientScopesLoader) {
  1758. return RealmDefaultClientScopesLoader();
  1759. },
  1760. realmOptionalClientScopes : function(RealmOptionalClientScopesLoader) {
  1761. return RealmOptionalClientScopesLoader();
  1762. }
  1763. },
  1764. controller : 'ClientScopesRealmDefaultCtrl'
  1765. })
  1766. .when('/import/client/:realm', {
  1767. templateUrl : resourceUrl + '/partials/client-import.html',
  1768. resolve : {
  1769. realm : function(RealmLoader) {
  1770. return RealmLoader();
  1771. },
  1772. serverInfo : function(ServerInfoLoader) {
  1773. return ServerInfoLoader();
  1774. }
  1775. },
  1776. controller : 'ClientImportCtrl'
  1777. })
  1778. .when('/realms/:realm/client-stores', {
  1779. templateUrl : resourceUrl + '/partials/client-storage-list.html',
  1780. resolve : {
  1781. realm : function(RealmLoader) {
  1782. return RealmLoader();
  1783. },
  1784. serverInfo : function(ServerInfoLoader) {
  1785. return ServerInfoLoader();
  1786. }
  1787. },
  1788. controller : 'ClientStoresCtrl'
  1789. })
  1790. .when('/realms/:realm/client-storage/providers/:provider/:componentId', {
  1791. templateUrl : resourceUrl + '/partials/client-storage-generic.html',
  1792. resolve : {
  1793. realm : function(RealmLoader) {
  1794. return RealmLoader();
  1795. },
  1796. instance : function(ComponentLoader) {
  1797. return ComponentLoader();
  1798. },
  1799. providerId : function($route) {
  1800. return $route.current.params.provider;
  1801. },
  1802. serverInfo : function(ServerInfoLoader) {
  1803. return ServerInfoLoader();
  1804. }
  1805. },
  1806. controller : 'GenericClientStorageCtrl'
  1807. })
  1808. .when('/create/client-storage/:realm/providers/:provider', {
  1809. templateUrl : resourceUrl + '/partials/client-storage-generic.html',
  1810. resolve : {
  1811. realm : function(RealmLoader) {
  1812. return RealmLoader();
  1813. },
  1814. instance : function() {
  1815. return {
  1816. };
  1817. },
  1818. providerId : function($route) {
  1819. return $route.current.params.provider;
  1820. },
  1821. serverInfo : function(ServerInfoLoader) {
  1822. return ServerInfoLoader();
  1823. }
  1824. },
  1825. controller : 'GenericClientStorageCtrl'
  1826. })
  1827. .when('/', {
  1828. templateUrl : resourceUrl + '/partials/home.html',
  1829. controller : 'HomeCtrl'
  1830. })
  1831. .when('/mocks/:realm', {
  1832. templateUrl : resourceUrl + '/partials/realm-detail_mock.html',
  1833. resolve : {
  1834. realm : function(RealmLoader) {
  1835. return RealmLoader();
  1836. },
  1837. serverInfo : function(ServerInfoLoader) {
  1838. return ServerInfoLoader();
  1839. }
  1840. },
  1841. controller : 'RealmDetailCtrl'
  1842. })
  1843. .when('/realms/:realm/sessions/revocation', {
  1844. templateUrl : resourceUrl + '/partials/session-revocation.html',
  1845. resolve : {
  1846. realm : function(RealmLoader) {
  1847. return RealmLoader();
  1848. }
  1849. },
  1850. controller : 'RealmRevocationCtrl'
  1851. })
  1852. .when('/realms/:realm/sessions/realm', {
  1853. templateUrl : resourceUrl + '/partials/session-realm.html',
  1854. resolve : {
  1855. realm : function(RealmLoader) {
  1856. return RealmLoader();
  1857. },
  1858. stats : function(RealmClientSessionStatsLoader) {
  1859. return RealmClientSessionStatsLoader();
  1860. }
  1861. },
  1862. controller : 'RealmSessionStatsCtrl'
  1863. })
  1864. .when('/create/user-storage/:realm/providers/ldap', {
  1865. templateUrl : resourceUrl + '/partials/user-storage-ldap.html',
  1866. resolve : {
  1867. realm : function(RealmLoader) {
  1868. return RealmLoader();
  1869. },
  1870. instance : function() {
  1871. return {
  1872. };
  1873. },
  1874. providerId : function($route) {
  1875. return $route.current.params.provider;
  1876. },
  1877. serverInfo : function(ServerInfoLoader) {
  1878. return ServerInfoLoader();
  1879. }
  1880. },
  1881. controller : 'LDAPUserStorageCtrl'
  1882. })
  1883. .when('/create/user-storage/:realm/providers/kerberos', {
  1884. templateUrl : resourceUrl + '/partials/user-storage-kerberos.html',
  1885. resolve : {
  1886. realm : function(RealmLoader) {
  1887. return RealmLoader();
  1888. },
  1889. instance : function() {
  1890. return {
  1891. };
  1892. },
  1893. providerId : function($route) {
  1894. return "kerberos";
  1895. },
  1896. serverInfo : function(ServerInfoLoader) {
  1897. return ServerInfoLoader();
  1898. }
  1899. },
  1900. controller : 'GenericUserStorageCtrl'
  1901. })
  1902. .when('/create/user-storage/:realm/providers/:provider', {
  1903. templateUrl : resourceUrl + '/partials/user-storage-generic.html',
  1904. resolve : {
  1905. realm : function(RealmLoader) {
  1906. return RealmLoader();
  1907. },
  1908. instance : function() {
  1909. return {
  1910. };
  1911. },
  1912. providerId : function($route) {
  1913. return $route.current.params.provider;
  1914. },
  1915. serverInfo : function(ServerInfoLoader) {
  1916. return ServerInfoLoader();
  1917. }
  1918. },
  1919. controller : 'GenericUserStorageCtrl'
  1920. })
  1921. .when('/realms/:realm/user-storage/providers/ldap/:componentId', {
  1922. templateUrl : resourceUrl + '/partials/user-storage-ldap.html',
  1923. resolve : {
  1924. realm : function(RealmLoader) {
  1925. return RealmLoader();
  1926. },
  1927. instance : function(ComponentLoader) {
  1928. return ComponentLoader();
  1929. },
  1930. providerId : function($route) {
  1931. return $route.current.params.provider;
  1932. },
  1933. serverInfo : function(ServerInfoLoader) {
  1934. return ServerInfoLoader();
  1935. }
  1936. },
  1937. controller : 'LDAPUserStorageCtrl'
  1938. })
  1939. .when('/realms/:realm/user-storage/providers/kerberos/:componentId', {
  1940. templateUrl : resourceUrl + '/partials/user-storage-kerberos.html',
  1941. resolve : {
  1942. realm : function(RealmLoader) {
  1943. return RealmLoader();
  1944. },
  1945. instance : function(ComponentLoader) {
  1946. return ComponentLoader();
  1947. },
  1948. providerId : function($route) {
  1949. return "kerberos";
  1950. },
  1951. serverInfo : function(ServerInfoLoader) {
  1952. return ServerInfoLoader();
  1953. }
  1954. },
  1955. controller : 'GenericUserStorageCtrl'
  1956. })
  1957. .when('/realms/:realm/user-storage/providers/:provider/:componentId', {
  1958. templateUrl : resourceUrl + '/partials/user-storage-generic.html',
  1959. resolve : {
  1960. realm : function(RealmLoader) {
  1961. return RealmLoader();
  1962. },
  1963. instance : function(ComponentLoader) {
  1964. return ComponentLoader();
  1965. },
  1966. providerId : function($route) {
  1967. return $route.current.params.provider;
  1968. },
  1969. serverInfo : function(ServerInfoLoader) {
  1970. return ServerInfoLoader();
  1971. }
  1972. },
  1973. controller : 'GenericUserStorageCtrl'
  1974. })
  1975. .when('/realms/:realm/ldap-mappers/:componentId', {
  1976. templateUrl : function(params){ return resourceUrl + '/partials/user-storage-ldap-mappers.html'; },
  1977. resolve : {
  1978. realm : function(RealmLoader) {
  1979. return RealmLoader();
  1980. },
  1981. provider : function(ComponentLoader) {
  1982. return ComponentLoader();
  1983. },
  1984. mappers : function(ComponentsLoader, $route) {
  1985. return ComponentsLoader.loadComponents($route.current.params.componentId, 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper');
  1986. }
  1987. },
  1988. controller : 'LDAPMapperListCtrl'
  1989. })
  1990. .when('/create/ldap-mappers/:realm/:componentId', {
  1991. templateUrl : function(params){ return resourceUrl + '/partials/user-storage-ldap-mapper-detail.html'; },
  1992. resolve : {
  1993. realm : function(RealmLoader) {
  1994. return RealmLoader();
  1995. },
  1996. provider : function(ComponentLoader) {
  1997. return ComponentLoader();
  1998. },
  1999. mapperTypes : function(SubComponentTypesLoader, $route) {
  2000. return SubComponentTypesLoader.loadComponents($route.current.params.componentId, 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper');
  2001. },
  2002. clients : function(ClientListLoader) {
  2003. return ClientListLoader();
  2004. }
  2005. },
  2006. controller : 'LDAPMapperCreateCtrl'
  2007. })
  2008. .when('/realms/:realm/ldap-mappers/:componentId/mappers/:mapperId', {
  2009. templateUrl : function(params){ return resourceUrl + '/partials/user-storage-ldap-mapper-detail.html'; },
  2010. resolve : {
  2011. realm : function(RealmLoader) {
  2012. return RealmLoader();
  2013. },
  2014. provider : function(ComponentLoader) {
  2015. return ComponentLoader();
  2016. },
  2017. mapperTypes : function(SubComponentTypesLoader, $route) {
  2018. return SubComponentTypesLoader.loadComponents($route.current.params.componentId, 'org.keycloak.storage.ldap.mappers.LDAPStorageMapper');
  2019. },
  2020. mapper : function(LDAPMapperLoader) {
  2021. return LDAPMapperLoader();
  2022. },
  2023. clients : function(ClientListLoader) {
  2024. return ClientListLoader();
  2025. }
  2026. },
  2027. controller : 'LDAPMapperCtrl'
  2028. })
  2029. .when('/realms/:realm/user-federation', {
  2030. templateUrl : resourceUrl + '/partials/user-federation.html',
  2031. resolve : {
  2032. realm : function(RealmLoader) {
  2033. return RealmLoader();
  2034. },
  2035. serverInfo : function(ServerInfoLoader) {
  2036. return ServerInfoLoader();
  2037. }
  2038. },
  2039. controller : 'UserFederationCtrl'
  2040. })
  2041. .when('/realms/:realm/defense/headers', {
  2042. templateUrl : resourceUrl + '/partials/defense-headers.html',
  2043. resolve : {
  2044. realm : function(RealmLoader) {
  2045. return RealmLoader();
  2046. },
  2047. serverInfo : function(ServerInfoLoader) {
  2048. return ServerInfoLoader();
  2049. }
  2050. },
  2051. controller : 'DefenseHeadersCtrl'
  2052. })
  2053. .when('/realms/:realm/defense/brute-force', {
  2054. templateUrl : resourceUrl + '/partials/brute-force.html',
  2055. resolve : {
  2056. realm : function(RealmLoader) {
  2057. return RealmLoader();
  2058. }
  2059. },
  2060. controller : 'RealmBruteForceCtrl'
  2061. })
  2062. .when('/realms/:realm/protocols', {
  2063. templateUrl : resourceUrl + '/partials/protocol-list.html',
  2064. resolve : {
  2065. realm : function(RealmLoader) {
  2066. return RealmLoader();
  2067. },
  2068. serverInfo : function(ServerInfoLoader) {
  2069. return ServerInfoLoader();
  2070. }
  2071. },
  2072. controller : 'ProtocolListCtrl'
  2073. })
  2074. .when('/realms/:realm/authentication/flows', {
  2075. templateUrl : resourceUrl + '/partials/authentication-flows.html',
  2076. resolve : {
  2077. realm : function(RealmLoader) {
  2078. return RealmLoader();
  2079. },
  2080. flows : function(AuthenticationFlowsLoader) {
  2081. return AuthenticationFlowsLoader();
  2082. },
  2083. selectedFlow : function() {
  2084. return null;
  2085. }
  2086. },
  2087. controller : 'AuthenticationFlowsCtrl'
  2088. })
  2089. .when('/realms/:realm/authentication/flow-bindings', {
  2090. templateUrl : resourceUrl + '/partials/authentication-flow-bindings.html',
  2091. resolve : {
  2092. realm : function(RealmLoader) {
  2093. return RealmLoader();
  2094. },
  2095. flows : function(AuthenticationFlowsLoader) {
  2096. return AuthenticationFlowsLoader();
  2097. },
  2098. serverInfo : function(ServerInfoLoader) {
  2099. return ServerInfoLoader();
  2100. }
  2101. },
  2102. controller : 'RealmFlowBindingCtrl'
  2103. })
  2104. .when('/realms/:realm/authentication/flows/:flow', {
  2105. templateUrl : resourceUrl + '/partials/authentication-flows.html',
  2106. resolve : {
  2107. realm : function(RealmLoader) {
  2108. return RealmLoader();
  2109. },
  2110. flows : function(AuthenticationFlowsLoader) {
  2111. return AuthenticationFlowsLoader();
  2112. },
  2113. selectedFlow : function($route) {
  2114. return $route.current.params.flow;
  2115. }
  2116. },
  2117. controller : 'AuthenticationFlowsCtrl'
  2118. })
  2119. .when('/realms/:realm/authentication/flows/:flow/create/execution/:topFlow', {
  2120. templateUrl : resourceUrl + '/partials/create-execution.html',
  2121. resolve : {
  2122. realm : function(RealmLoader) {
  2123. return RealmLoader();
  2124. },
  2125. topFlow: function($route) {
  2126. return $route.current.params.topFlow;
  2127. },
  2128. parentFlow : function(AuthenticationFlowLoader) {
  2129. return AuthenticationFlowLoader();
  2130. },
  2131. formActionProviders : function(AuthenticationFormActionProvidersLoader) {
  2132. return AuthenticationFormActionProvidersLoader();
  2133. },
  2134. authenticatorProviders : function(AuthenticatorProvidersLoader) {
  2135. return AuthenticatorProvidersLoader();
  2136. },
  2137. clientAuthenticatorProviders : function(ClientAuthenticatorProvidersLoader) {
  2138. return ClientAuthenticatorProvidersLoader();
  2139. }
  2140. },
  2141. controller : 'CreateExecutionCtrl'
  2142. })
  2143. .when('/realms/:realm/authentication/flows/:flow/create/flow/execution/:topFlow', {
  2144. templateUrl : resourceUrl + '/partials/create-flow-execution.html',
  2145. resolve : {
  2146. realm : function(RealmLoader) {
  2147. return RealmLoader();
  2148. },
  2149. topFlow: function($route) {
  2150. return $route.current.params.topFlow;
  2151. },
  2152. parentFlow : function(AuthenticationFlowLoader) {
  2153. return AuthenticationFlowLoader();
  2154. },
  2155. formProviders : function(AuthenticationFormProvidersLoader) {
  2156. return AuthenticationFormProvidersLoader();
  2157. }
  2158. },
  2159. controller : 'CreateExecutionFlowCtrl'
  2160. })
  2161. .when('/realms/:realm/authentication/create/flow', {
  2162. templateUrl : resourceUrl + '/partials/create-flow.html',
  2163. resolve : {
  2164. realm : function(RealmLoader) {
  2165. return RealmLoader();
  2166. }
  2167. },
  2168. controller : 'CreateFlowCtrl'
  2169. })
  2170. .when('/realms/:realm/authentication/required-actions', {
  2171. templateUrl : resourceUrl + '/partials/required-actions.html',
  2172. resolve : {
  2173. realm : function(RealmLoader) {
  2174. return RealmLoader();
  2175. },
  2176. unregisteredRequiredActions : function(UnregisteredRequiredActionsListLoader) {
  2177. return UnregisteredRequiredActionsListLoader();
  2178. }
  2179. },
  2180. controller : 'RequiredActionsCtrl'
  2181. })
  2182. .when('/realms/:realm/authentication/password-policy', {
  2183. templateUrl : resourceUrl + '/partials/password-policy.html',
  2184. resolve : {
  2185. realm : function(RealmLoader) {
  2186. return RealmLoader();
  2187. },
  2188. serverInfo : function(ServerInfoLoader) {
  2189. return ServerInfoLoader();
  2190. }
  2191. },
  2192. controller : 'RealmPasswordPolicyCtrl'
  2193. })
  2194. .when('/realms/:realm/authentication/otp-policy', {
  2195. templateUrl : resourceUrl + '/partials/otp-policy.html',
  2196. resolve : {
  2197. realm : function(RealmLoader) {
  2198. return RealmLoader();
  2199. },
  2200. serverInfo : function(ServerInfoLoader) {
  2201. return ServerInfoLoader();
  2202. }
  2203. },
  2204. controller : 'RealmOtpPolicyCtrl'
  2205. })
  2206. .when('/realms/:realm/authentication/webauthn-policy', {
  2207. templateUrl : resourceUrl + '/partials/webauthn-policy.html',
  2208. resolve : {
  2209. realm : function(RealmLoader) {
  2210. return RealmLoader();
  2211. },
  2212. serverInfo : function(ServerInfoLoader) {
  2213. return ServerInfoLoader();
  2214. }
  2215. },
  2216. controller : 'RealmWebAuthnPolicyCtrl'
  2217. })
  2218. .when('/realms/:realm/authentication/webauthn-policy-passwordless', {
  2219. templateUrl : resourceUrl + '/partials/webauthn-policy-passwordless.html',
  2220. resolve : {
  2221. realm : function(RealmLoader) {
  2222. return RealmLoader();
  2223. },
  2224. serverInfo : function(ServerInfoLoader) {
  2225. return ServerInfoLoader();
  2226. }
  2227. },
  2228. controller : 'RealmWebAuthnPasswordlessPolicyCtrl'
  2229. })
  2230. .when('/realms/:realm/authentication/ciba-policy', {
  2231. templateUrl : resourceUrl + '/partials/ciba-policy.html',
  2232. resolve : {
  2233. realm : function(RealmLoader) {
  2234. return RealmLoader();
  2235. },
  2236. serverInfo : function(ServerInfoLoader) {
  2237. return ServerInfoLoader();
  2238. }
  2239. },
  2240. controller : 'RealmCibaPolicyCtrl'
  2241. })
  2242. .when('/realms/:realm/authentication/flows/:flow/config/:provider/:config', {
  2243. templateUrl : resourceUrl + '/partials/authenticator-config.html',
  2244. resolve : {
  2245. realm : function(RealmLoader) {
  2246. return RealmLoader();
  2247. },
  2248. flow : function(AuthenticationFlowLoader) {
  2249. return AuthenticationFlowLoader();
  2250. },
  2251. configType : function(AuthenticationConfigDescriptionLoader) {
  2252. return AuthenticationConfigDescriptionLoader();
  2253. },
  2254. config : function(AuthenticationConfigLoader) {
  2255. return AuthenticationConfigLoader();
  2256. }
  2257. },
  2258. controller : 'AuthenticationConfigCtrl'
  2259. })
  2260. .when('/create/authentication/:realm/flows/:flow/execution/:executionId/provider/:provider', {
  2261. templateUrl : resourceUrl + '/partials/authenticator-config.html',
  2262. resolve : {
  2263. realm : function(RealmLoader) {
  2264. return RealmLoader();
  2265. },
  2266. flow : function(AuthenticationFlowLoader) {
  2267. return AuthenticationFlowLoader();
  2268. },
  2269. configType : function(AuthenticationConfigDescriptionLoader) {
  2270. return AuthenticationConfigDescriptionLoader();
  2271. },
  2272. execution : function(ExecutionIdLoader) {
  2273. return ExecutionIdLoader();
  2274. }
  2275. },
  2276. controller : 'AuthenticationConfigCreateCtrl'
  2277. })
  2278. .when('/create/localization/:realm/:locale', {
  2279. templateUrl : resourceUrl + '/partials/realm-localization-detail.html',
  2280. resolve : {
  2281. realm : function(RealmLoader) {
  2282. return RealmLoader();
  2283. },
  2284. locale: function($route) {
  2285. return $route.current.params.locale;
  2286. },
  2287. key: function() {
  2288. return null
  2289. },
  2290. localizationText : function() {
  2291. return null;
  2292. }
  2293. },
  2294. controller : 'RealmLocalizationDetailCtrl'
  2295. })
  2296. .when('/realms/:realm/localization/:locale/:key', {
  2297. templateUrl : resourceUrl + '/partials/realm-localization-detail.html',
  2298. resolve : {
  2299. realm : function(RealmLoader) {
  2300. return RealmLoader();
  2301. },
  2302. locale: function($route) {
  2303. return $route.current.params.locale;
  2304. },
  2305. key: function($route) {
  2306. return $route.current.params.key;
  2307. },
  2308. localizationText : function(RealmSpecificlocalizationTextLoader) {
  2309. return RealmSpecificlocalizationTextLoader();
  2310. }
  2311. },
  2312. controller : 'RealmLocalizationDetailCtrl'
  2313. })
  2314. .when('/server-info', {
  2315. templateUrl : resourceUrl + '/partials/server-info.html',
  2316. resolve : {
  2317. serverInfo : function(ServerInfoLoader) {
  2318. return ServerInfoLoader();
  2319. }
  2320. },
  2321. controller : 'ServerInfoCtrl'
  2322. })
  2323. .when('/server-info/providers', {
  2324. templateUrl : resourceUrl + '/partials/server-info-providers.html',
  2325. resolve : {
  2326. serverInfo : function(ServerInfoLoader) {
  2327. return ServerInfoLoader();
  2328. }
  2329. },
  2330. controller : 'ServerInfoCtrl'
  2331. })
  2332. .when('/logout', {
  2333. templateUrl : resourceUrl + '/partials/home.html',
  2334. controller : 'LogoutCtrl'
  2335. })
  2336. .when('/notfound', {
  2337. templateUrl : resourceUrl + '/partials/notfound.html'
  2338. })
  2339. .when('/forbidden', {
  2340. templateUrl : resourceUrl + '/partials/forbidden.html'
  2341. })
  2342. .otherwise({
  2343. templateUrl : resourceUrl + '/partials/pagenotfound.html'
  2344. });
  2345. } ]);
  2346. module.config(function($httpProvider) {
  2347. $httpProvider.interceptors.push('errorInterceptor');
  2348. var spinnerFunction = function(data, headersGetter) {
  2349. if (resourceRequests == 0) {
  2350. loadingTimer = window.setTimeout(function() {
  2351. $('#loading').show();
  2352. loadingTimer = -1;
  2353. }, 500);
  2354. }
  2355. resourceRequests++;
  2356. return data;
  2357. };
  2358. $httpProvider.defaults.transformRequest.push(spinnerFunction);
  2359. $httpProvider.interceptors.push('spinnerInterceptor');
  2360. $httpProvider.interceptors.push('authInterceptor');
  2361. });
  2362. module.factory('spinnerInterceptor', function($q, $window, $rootScope, $location) {
  2363. return {
  2364. response: function(response) {
  2365. resourceRequests--;
  2366. if (resourceRequests == 0) {
  2367. if(loadingTimer != -1) {
  2368. window.clearTimeout(loadingTimer);
  2369. loadingTimer = -1;
  2370. }
  2371. $('#loading').hide();
  2372. }
  2373. return response;
  2374. },
  2375. responseError: function(response) {
  2376. resourceRequests--;
  2377. if (resourceRequests == 0) {
  2378. if(loadingTimer != -1) {
  2379. window.clearTimeout(loadingTimer);
  2380. loadingTimer = -1;
  2381. }
  2382. $('#loading').hide();
  2383. }
  2384. return $q.reject(response);
  2385. }
  2386. };
  2387. });
  2388. module.factory('errorInterceptor', function($q, $window, $rootScope, $location, Notifications, Auth) {
  2389. return {
  2390. response: function(response) {
  2391. return response;
  2392. },
  2393. responseError: function(response) {
  2394. if (response.status == 401) {
  2395. Auth.authz.logout();
  2396. } else if (response.status == 403) {
  2397. $location.path('/forbidden');
  2398. } else if (response.status == 404) {
  2399. $location.path('/notfound');
  2400. } else if (response.status) {
  2401. if (response.data && response.data.errorMessage) {
  2402. Notifications.error(response.data.errorMessage);
  2403. } else if (response.data && response.data.errors) {
  2404. var messages = "Multiple errors found: ";
  2405. for (var i = 0; i < response.data.errors.length; i++) {
  2406. messages+=response.data.errors[i].errorMessage + " ";
  2407. }
  2408. Notifications.error(messages);
  2409. } else if (response.data && response.data.error_description) {
  2410. Notifications.error(response.data.error_description);
  2411. } else {
  2412. Notifications.error("An unexpected server error has occurred");
  2413. }
  2414. } else {
  2415. Notifications.error("No response from server.");
  2416. }
  2417. return $q.reject(response);
  2418. }
  2419. };
  2420. });
  2421. // collapsable form fieldsets
  2422. module.directive('collapsable', function() {
  2423. return function(scope, element, attrs) {
  2424. element.click(function() {
  2425. $(this).toggleClass('collapsed');
  2426. $(this).find('.toggle-icons').toggleClass('kc-icon-collapse').toggleClass('kc-icon-expand');
  2427. $(this).find('.toggle-icons').text($(this).text() == "Icon: expand" ? "Icon: collapse" : "Icon: expand");
  2428. $(this).parent().find('.form-group').toggleClass('hidden');
  2429. });
  2430. }
  2431. });
  2432. // collapsable form fieldsets
  2433. module.directive('uncollapsed', function() {
  2434. return function(scope, element, attrs) {
  2435. element.prepend('<i class="toggle-class fa fa-angle-down"></i> ');
  2436. element.click(function() {
  2437. $(this).find('.toggle-class').toggleClass('fa-angle-down').toggleClass('fa-angle-right');
  2438. $(this).parent().find('.form-group').toggleClass('hidden');
  2439. });
  2440. }
  2441. });
  2442. // collapsable form fieldsets
  2443. module.directive('collapsed', function() {
  2444. return function(scope, element, attrs) {
  2445. element.prepend('<i class="toggle-class fa fa-angle-right"></i> ');
  2446. element.parent().find('.form-group').toggleClass('hidden');
  2447. element.click(function() {
  2448. $(this).find('.toggle-class').toggleClass('fa-angle-down').toggleClass('fa-angle-right');
  2449. $(this).parent().find('.form-group').toggleClass('hidden');
  2450. });
  2451. }
  2452. });
  2453. /**
  2454. * Directive for presenting an ON-OFF switch for checkbox.
  2455. * Usage: <input ng-model="mmm" name="nnn" id="iii" onoffswitch [on-text="ooo" off-text="fff"] />
  2456. */
  2457. module.directive('onoffswitch', function() {
  2458. return {
  2459. restrict: "EA",
  2460. replace: true,
  2461. scope: {
  2462. name: '@',
  2463. id: '@',
  2464. ngModel: '=',
  2465. ngDisabled: '=',
  2466. kcOnText: '@onText',
  2467. kcOffText: '@offText'
  2468. },
  2469. // TODO - The same code acts differently when put into the templateURL. Find why and move the code there.
  2470. //templateUrl: "templates/kc-switch.html",
  2471. template: "<span><div class='onoffswitch' tabindex='0'><input type='checkbox' ng-model='ngModel' ng-disabled='ngDisabled' class='onoffswitch-checkbox' name='{{name}}' id='{{id}}'><label for='{{id}}' class='onoffswitch-label'><span class='onoffswitch-inner'><span class='onoffswitch-active'>{{kcOnText}}</span><span class='onoffswitch-inactive'>{{kcOffText}}</span></span><span class='onoffswitch-switch'></span></label></div></span>",
  2472. compile: function(element, attrs) {
  2473. /*
  2474. We don't want to propagate basic attributes to the root element of directive. Id should be passed to the
  2475. input element only to achieve proper label binding (and validity).
  2476. */
  2477. element.removeAttr('name');
  2478. element.removeAttr('id');
  2479. if (!attrs.onText) { attrs.onText = "ON"; }
  2480. if (!attrs.offText) { attrs.offText = "OFF"; }
  2481. element.bind('keydown', function(e){
  2482. var code = e.keyCode || e.which;
  2483. if (code === 32 || code === 13) {
  2484. e.stopImmediatePropagation();
  2485. e.preventDefault();
  2486. $(e.target).find('input').click();
  2487. }
  2488. });
  2489. }
  2490. }
  2491. });
  2492. /**
  2493. * Directive for presenting an ON-OFF switch for checkbox. The directive expects the value to be string 'true' or 'false', not boolean true/false
  2494. * This directive provides some additional capabilities to the default onoffswitch such as:
  2495. *
  2496. * - Dynamic values for id and name attributes. Useful if you need to use this directive inside a ng-repeat
  2497. * - Specific scope to specify the value. Instead of just true or false.
  2498. *
  2499. * Usage: <input ng-model="mmm" name="nnn" id="iii" kc-onoffswitch-model [on-text="ooo" off-text="fff"] />
  2500. */
  2501. module.directive('onoffswitchstring', function() {
  2502. return {
  2503. restrict: "EA",
  2504. replace: true,
  2505. scope: {
  2506. name: '=',
  2507. id: '=',
  2508. value: '=',
  2509. ngModel: '=',
  2510. ngDisabled: '=',
  2511. kcOnText: '@onText',
  2512. kcOffText: '@offText'
  2513. },
  2514. // TODO - The same code acts differently when put into the templateURL. Find why and move the code there.
  2515. //templateUrl: "templates/kc-switch.html",
  2516. template: '<span><div class="onoffswitch" tabindex="0"><input type="checkbox" ng-true-value="\'true\'" ng-false-value="\'false\'" ng-model="ngModel" ng-disabled="ngDisabled" class="onoffswitch-checkbox" name="kc{{name}}" id="kc{{id}}"><label for="kc{{id}}" class="onoffswitch-label"><span class="onoffswitch-inner"><span class="onoffswitch-active">{{kcOnText}}</span><span class="onoffswitch-inactive">{{kcOffText}}</span></span><span class="onoffswitch-switch"></span></label></div></span>',
  2517. compile: function(element, attrs) {
  2518. if (!attrs.onText) { attrs.onText = "ON"; }
  2519. if (!attrs.offText) { attrs.offText = "OFF"; }
  2520. element.bind('keydown click', function(e){
  2521. var code = e.keyCode || e.which;
  2522. if (code === 32 || code === 13) {
  2523. e.stopImmediatePropagation();
  2524. e.preventDefault();
  2525. $(e.target).find('input').click();
  2526. }
  2527. });
  2528. }
  2529. }
  2530. });
  2531. /**
  2532. * Directive for presenting an ON-OFF switch for checkbox. The directive expects the true-value or false-value to be string like 'true' or 'false', not boolean true/false.
  2533. * This directive provides some additional capabilities to the default onoffswitch such as:
  2534. *
  2535. * - Specific scope to specify the value. Instead of just 'true' or 'false' you can use any other values. For example: true-value="'foo'" false-value="'bar'" .
  2536. * But 'true'/'false' are defaults if true-value and false-value are not specified
  2537. *
  2538. * Usage: <input ng-model="mmm" name="nnn" id="iii" onoffswitchvalue [ true-value="'true'" false-value="'false'" on-text="ooo" off-text="fff"] />
  2539. */
  2540. module.directive('onoffswitchvalue', function() {
  2541. return {
  2542. restrict: "EA",
  2543. replace: true,
  2544. scope: {
  2545. name: '@',
  2546. id: '@',
  2547. trueValue: '@',
  2548. falseValue: '@',
  2549. ngModel: '=',
  2550. ngDisabled: '=',
  2551. kcOnText: '@onText',
  2552. kcOffText: '@offText'
  2553. },
  2554. // TODO - The same code acts differently when put into the templateURL. Find why and move the code there.
  2555. //templateUrl: "templates/kc-switch.html",
  2556. template: "<span><div class='onoffswitch' tabindex='0'><input type='checkbox' ng-true-value='{{trueValue}}' ng-false-value='{{falseValue}}' ng-model='ngModel' ng-disabled='ngDisabled' class='onoffswitch-checkbox' name='{{name}}' id='{{id}}'><label for='{{id}}' class='onoffswitch-label'><span class='onoffswitch-inner'><span class='onoffswitch-active'>{{kcOnText}}</span><span class='onoffswitch-inactive'>{{kcOffText}}</span></span><span class='onoffswitch-switch'></span></label></div></span>",
  2557. compile: function(element, attrs) {
  2558. /*
  2559. We don't want to propagate basic attributes to the root element of directive. Id should be passed to the
  2560. input element only to achieve proper label binding (and validity).
  2561. */
  2562. element.removeAttr('name');
  2563. element.removeAttr('id');
  2564. if (!attrs.trueValue) { attrs.trueValue = "'true'"; }
  2565. if (!attrs.falseValue) { attrs.falseValue = "'false'"; }
  2566. if (!attrs.onText) { attrs.onText = "ON"; }
  2567. if (!attrs.offText) { attrs.offText = "OFF"; }
  2568. element.bind('keydown', function(e){
  2569. var code = e.keyCode || e.which;
  2570. if (code === 32 || code === 13) {
  2571. e.stopImmediatePropagation();
  2572. e.preventDefault();
  2573. $(e.target).find('input').click();
  2574. }
  2575. });
  2576. }
  2577. }
  2578. });
  2579. module.directive('kcInput', function() {
  2580. var d = {
  2581. scope : true,
  2582. replace : false,
  2583. link : function(scope, element, attrs) {
  2584. var form = element.children('form');
  2585. var label = element.children('label');
  2586. var input = element.children('input');
  2587. var id = form.attr('name') + '.' + input.attr('name');
  2588. element.attr('class', 'control-group');
  2589. label.attr('class', 'control-label');
  2590. label.attr('for', id);
  2591. input.wrap('<div class="controls"/>');
  2592. input.attr('id', id);
  2593. if (!input.attr('placeHolder')) {
  2594. input.attr('placeHolder', label.text());
  2595. }
  2596. if (input.attr('required')) {
  2597. label.append(' <span class="required">*</span>');
  2598. }
  2599. }
  2600. };
  2601. return d;
  2602. });
  2603. module.directive('kcEnter', function() {
  2604. return function(scope, element, attrs) {
  2605. element.bind("keydown keypress", function(event) {
  2606. if (event.which === 13) {
  2607. scope.$apply(function() {
  2608. scope.$eval(attrs.kcEnter);
  2609. });
  2610. event.preventDefault();
  2611. }
  2612. });
  2613. };
  2614. });
  2615. // Don't allow URI reserved characters
  2616. module.directive('kcNoReservedChars', function (Notifications, $translate) {
  2617. return function($scope, element) {
  2618. element.bind("keypress", function(event) {
  2619. var keyPressed = String.fromCharCode(event.which || event.keyCode || 0);
  2620. // ] and ' can not be used inside a character set on POSIX and GNU
  2621. if (keyPressed.match('[:/?#[@!$&()*+,;=]') || keyPressed === ']' || keyPressed === '\'') {
  2622. event.preventDefault();
  2623. $scope.$apply(function() {
  2624. Notifications.warn($translate.instant('key-not-allowed-here', {character: keyPressed}));
  2625. });
  2626. }
  2627. });
  2628. };
  2629. });
  2630. module.directive('kcSave', function ($compile, $timeout, Notifications) {
  2631. var clickDelay = 500; // 500 ms
  2632. return {
  2633. restrict: 'A',
  2634. link: function ($scope, elem, attr, ctrl) {
  2635. elem.addClass("btn btn-primary");
  2636. elem.attr("type","submit");
  2637. var disabled = false;
  2638. elem.on('click', function(evt) {
  2639. if ($scope.hasOwnProperty("changed") && !$scope.changed) return;
  2640. // KEYCLOAK-4121: Prevent double form submission
  2641. if (disabled) {
  2642. evt.preventDefault();
  2643. evt.stopImmediatePropagation();
  2644. return;
  2645. } else {
  2646. disabled = true;
  2647. $timeout(function () { disabled = false; }, clickDelay, false);
  2648. }
  2649. $scope.$apply(function() {
  2650. var form = elem.closest('form');
  2651. if (form && form.attr('name')) {
  2652. var ngValid = form.find('.ng-valid');
  2653. if ($scope[form.attr('name')].$valid) {
  2654. //ngValid.removeClass('error');
  2655. ngValid.parent().removeClass('has-error');
  2656. $scope['save']();
  2657. } else {
  2658. Notifications.error("Missing or invalid field(s). Please verify the fields in red.")
  2659. //ngValid.removeClass('error');
  2660. ngValid.parent().removeClass('has-error');
  2661. var ngInvalid = form.find('.ng-invalid');
  2662. //ngInvalid.addClass('error');
  2663. ngInvalid.parent().addClass('has-error');
  2664. }
  2665. }
  2666. });
  2667. })
  2668. }
  2669. }
  2670. });
  2671. module.directive('kcReset', function ($compile, Notifications) {
  2672. return {
  2673. restrict: 'A',
  2674. link: function ($scope, elem, attr, ctrl) {
  2675. elem.addClass("btn btn-default");
  2676. elem.attr("type","submit");
  2677. elem.bind('click', function() {
  2678. $scope.$apply(function() {
  2679. var form = elem.closest('form');
  2680. if (form && form.attr('name')) {
  2681. form.find('.ng-valid').removeClass('error');
  2682. form.find('.ng-invalid').removeClass('error');
  2683. $scope['reset']();
  2684. }
  2685. })
  2686. })
  2687. }
  2688. }
  2689. });
  2690. module.directive('kcCancel', function ($compile, Notifications) {
  2691. return {
  2692. restrict: 'A',
  2693. link: function ($scope, elem, attr, ctrl) {
  2694. elem.addClass("btn btn-default");
  2695. elem.attr("type","submit");
  2696. }
  2697. }
  2698. });
  2699. module.directive('kcDelete', function ($compile, Notifications) {
  2700. return {
  2701. restrict: 'A',
  2702. link: function ($scope, elem, attr, ctrl) {
  2703. elem.addClass("btn btn-danger");
  2704. elem.attr("type","submit");
  2705. }
  2706. }
  2707. });
  2708. module.directive('kcDropdown', function ($compile, Notifications) {
  2709. return {
  2710. scope: {
  2711. kcOptions: '=',
  2712. kcModel: '=',
  2713. id: "=",
  2714. kcPlaceholder: '@'
  2715. },
  2716. restrict: 'EA',
  2717. replace: true,
  2718. templateUrl: resourceUrl + '/templates/kc-select.html',
  2719. link: function(scope, element, attr) {
  2720. scope.updateModel = function(item) {
  2721. scope.kcModel = item;
  2722. };
  2723. }
  2724. }
  2725. });
  2726. module.directive('kcReadOnly', function() {
  2727. var disabled = {};
  2728. var d = {
  2729. replace : false,
  2730. link : function(scope, element, attrs) {
  2731. var disable = function(i, e) {
  2732. if (!e.disabled) {
  2733. disabled[e.tagName + i] = true;
  2734. e.disabled = true;
  2735. }
  2736. }
  2737. var enable = function(i, e) {
  2738. if (disabled[e.tagName + i]) {
  2739. e.disabled = false;
  2740. delete disabled[i];
  2741. }
  2742. }
  2743. var filterIgnored = function(i, e){
  2744. return !e.attributes['kc-read-only-ignore'];
  2745. }
  2746. scope.$watch(attrs.kcReadOnly, function(readOnly) {
  2747. if (readOnly) {
  2748. element.find('input').filter(filterIgnored).each(disable);
  2749. element.find('button').filter(filterIgnored).each(disable);
  2750. element.find('select').filter(filterIgnored).each(disable);
  2751. element.find('textarea').filter(filterIgnored).each(disable);
  2752. } else {
  2753. element.find('input').filter(filterIgnored).each(enable);
  2754. element.find('input').filter(filterIgnored).each(enable);
  2755. element.find('button').filter(filterIgnored).each(enable);
  2756. element.find('select').filter(filterIgnored).each(enable);
  2757. element.find('textarea').filter(filterIgnored).each(enable);
  2758. }
  2759. });
  2760. }
  2761. };
  2762. return d;
  2763. });
  2764. module.directive('kcMenu', function () {
  2765. return {
  2766. scope: true,
  2767. restrict: 'E',
  2768. replace: true,
  2769. templateUrl: resourceUrl + '/templates/kc-menu.html'
  2770. }
  2771. });
  2772. module.directive('kcTabsRealm', function () {
  2773. return {
  2774. scope: true,
  2775. restrict: 'E',
  2776. replace: true,
  2777. templateUrl: resourceUrl + '/templates/kc-tabs-realm.html'
  2778. }
  2779. });
  2780. module.directive('kcTabsAuthentication', function () {
  2781. return {
  2782. scope: true,
  2783. restrict: 'E',
  2784. replace: true,
  2785. templateUrl: resourceUrl + '/templates/kc-tabs-authentication.html'
  2786. }
  2787. });
  2788. module.directive('kcTabsRole', function () {
  2789. return {
  2790. scope: true,
  2791. restrict: 'E',
  2792. replace: true,
  2793. templateUrl: resourceUrl + '/templates/kc-tabs-role.html'
  2794. }
  2795. });
  2796. module.directive('kcTabsClientRole', function () {
  2797. return {
  2798. scope: true,
  2799. restrict: 'E',
  2800. replace: true,
  2801. templateUrl: resourceUrl + '/templates/kc-tabs-client-role.html'
  2802. }
  2803. });
  2804. module.directive('kcTabsUser', function () {
  2805. return {
  2806. scope: true,
  2807. restrict: 'E',
  2808. replace: true,
  2809. templateUrl: resourceUrl + '/templates/kc-tabs-user.html'
  2810. }
  2811. });
  2812. module.directive('kcTabsUsers', function () {
  2813. return {
  2814. scope: true,
  2815. restrict: 'E',
  2816. replace: true,
  2817. templateUrl: resourceUrl + '/templates/kc-tabs-users.html'
  2818. }
  2819. });
  2820. module.directive('kcTabsClients', function () {
  2821. return {
  2822. scope: true,
  2823. restrict: 'E',
  2824. replace: true,
  2825. templateUrl: resourceUrl + '/templates/kc-tabs-clients.html'
  2826. }
  2827. });
  2828. module.directive('kcTabsGroup', function () {
  2829. return {
  2830. scope: true,
  2831. restrict: 'E',
  2832. replace: true,
  2833. templateUrl: resourceUrl + '/templates/kc-tabs-group.html'
  2834. }
  2835. });
  2836. module.directive('kcTabsGroupList', function () {
  2837. return {
  2838. scope: true,
  2839. restrict: 'E',
  2840. replace: true,
  2841. templateUrl: resourceUrl + '/templates/kc-tabs-group-list.html'
  2842. }
  2843. });
  2844. module.directive('kcTabsClient', function () {
  2845. return {
  2846. scope: true,
  2847. restrict: 'E',
  2848. replace: true,
  2849. templateUrl: resourceUrl + '/templates/kc-tabs-client.html'
  2850. }
  2851. });
  2852. module.directive('kcTabsClientScope', function () {
  2853. return {
  2854. scope: true,
  2855. restrict: 'E',
  2856. replace: true,
  2857. templateUrl: resourceUrl + '/templates/kc-tabs-client-scope.html'
  2858. }
  2859. });
  2860. module.directive('kcNavigationUser', function () {
  2861. return {
  2862. scope: true,
  2863. restrict: 'E',
  2864. replace: true,
  2865. templateUrl: resourceUrl + '/templates/kc-navigation-user.html'
  2866. }
  2867. });
  2868. module.directive('kcTabsIdentityProvider', function () {
  2869. return {
  2870. scope: true,
  2871. restrict: 'E',
  2872. replace: true,
  2873. templateUrl: resourceUrl + '/templates/kc-tabs-identity-provider.html'
  2874. }
  2875. });
  2876. module.directive('kcTabsUserFederation', function () {
  2877. return {
  2878. scope: true,
  2879. restrict: 'E',
  2880. replace: true,
  2881. templateUrl: resourceUrl + '/templates/kc-tabs-user-federation.html'
  2882. }
  2883. });
  2884. module.directive('kcTabsLdap', function () {
  2885. return {
  2886. scope: true,
  2887. restrict: 'E',
  2888. replace: true,
  2889. templateUrl: resourceUrl + '/templates/kc-tabs-ldap.html'
  2890. }
  2891. });
  2892. module.controller('RoleSelectorModalCtrl', function($scope, realm, config, configName, RealmRoles, Client, ClientRole, $modalInstance) {
  2893. $scope.selectedRealmRole = {
  2894. role: undefined
  2895. };
  2896. $scope.selectedClientRole = {
  2897. role: undefined
  2898. };
  2899. $scope.client = {
  2900. selected: undefined
  2901. };
  2902. $scope.selectRealmRole = function() {
  2903. config[configName] = $scope.selectedRealmRole.role.name;
  2904. $modalInstance.close();
  2905. }
  2906. $scope.selectClientRole = function() {
  2907. config[configName] = $scope.selectedClient.clientId + "." + $scope.selectedClientRole.role.name;
  2908. $modalInstance.close();
  2909. }
  2910. $scope.cancel = function() {
  2911. $modalInstance.dismiss();
  2912. }
  2913. clientSelectControl($scope, realm.realm, Client);
  2914. $scope.selectedClient = null;
  2915. $scope.changeClient = function(client) {
  2916. $scope.selectedClient = client;
  2917. if (!client || !client.id) {
  2918. $scope.selectedClient = null;
  2919. return;
  2920. }
  2921. if ($scope.selectedClient) {
  2922. ClientRole.query({realm: realm.realm, client: $scope.selectedClient.id}, function (data) {
  2923. $scope.clientRoles = data;
  2924. });
  2925. } else {
  2926. console.log('selected client was null');
  2927. $scope.clientRoles = null;
  2928. }
  2929. $scope.selectedClient = client;
  2930. }
  2931. RealmRoles.query({realm: realm.realm}, function(data) {
  2932. $scope.realmRoles = data;
  2933. })
  2934. });
  2935. module.controller('GroupSelectorModalCtrl', function($scope, $q, realm, config, configName, GroupsCount, Groups, Group, GroupChildren, Notifications, Dialog, ComponentUtils, $modalInstance, $translate) {
  2936. $scope.realm = realm;
  2937. $scope.groupList = [
  2938. {
  2939. "id" : "realm",
  2940. "name": $translate.instant('groups'),
  2941. "subGroups" : []
  2942. }
  2943. ];
  2944. $scope.groupSelector = {
  2945. searchCriteria: undefined,
  2946. currentPage: 1,
  2947. pageSize: 20,
  2948. numberOfPages: 1
  2949. };
  2950. $scope.groupSelector.currentPageInput = $scope.groupSelector.currentPage;
  2951. var refreshGroups = function (search) {
  2952. console.log('refreshGroups');
  2953. $scope.groupSelector.currentPageInput = $scope.groupSelector.currentPage;
  2954. var first = ($scope.groupSelector.currentPage * $scope.groupSelector.pageSize) - $scope.groupSelector.pageSize;
  2955. console.log('first:' + first);
  2956. var queryParams = {
  2957. realm : realm.realm,
  2958. first : first,
  2959. max : $scope.groupSelector.pageSize
  2960. };
  2961. var countParams = {
  2962. realm : realm.realm,
  2963. top : 'true'
  2964. };
  2965. if(angular.isDefined(search) && search !== '') {
  2966. queryParams.search = search;
  2967. countParams.search = search;
  2968. }
  2969. var promiseGetGroups = $q.defer();
  2970. Groups.query(queryParams, function(entry) {
  2971. promiseGetGroups.resolve(entry);
  2972. }, function() {
  2973. promiseGetGroups.reject($translate.instant('group.fetch.fail', {params: queryParams}));
  2974. });
  2975. promiseGetGroups.promise.then(function(groups) {
  2976. $scope.groupList = [
  2977. {
  2978. "id" : "realm",
  2979. "name": $translate.instant('groups'),
  2980. "subGroups": ComponentUtils.sortGroups('name', groups)
  2981. }
  2982. ];
  2983. if (angular.isDefined(search) && search !== '') {
  2984. // Add highlight for concrete text match
  2985. setTimeout(function () {
  2986. document.querySelectorAll('span').forEach(function (element) {
  2987. if (element.textContent.indexOf(search) != -1) {
  2988. angular.element(element).addClass('highlight');
  2989. }
  2990. });
  2991. }, 500);
  2992. }
  2993. }, function (failed) {
  2994. Notifications.error(failed);
  2995. });
  2996. var promiseCount = $q.defer();
  2997. console.log('countParams: realm[' + countParams.realm);
  2998. GroupsCount.query(countParams, function(entry) {
  2999. promiseCount.resolve(entry);
  3000. }, function() {
  3001. promiseCount.reject($translate.instant('group.fetch.fail', {params: countParams}));
  3002. });
  3003. promiseCount.promise.then(function(entry) {
  3004. if(angular.isDefined(entry.count) && entry.count > $scope.groupSelector.pageSize) {
  3005. $scope.groupSelector.numberOfPages = Math.ceil(entry.count/$scope.groupSelector.pageSize);
  3006. } else {
  3007. $scope.groupSelector.numberOfPages = 1;
  3008. }
  3009. }, function (failed) {
  3010. Notifications.error(failed);
  3011. });
  3012. };
  3013. refreshGroups();
  3014. $scope.$watch('groupSelector.currentPage', function(newValue, oldValue) {
  3015. if(parseInt(newValue, 10) !== oldValue) {
  3016. refreshGroups($scope.groupSelector.searchCriteria);
  3017. }
  3018. });
  3019. $scope.clearSearch = function() {
  3020. $scope.groupSelector.searchCriteria = '';
  3021. if (parseInt($scope.groupSelector.currentPage, 10) === 1) {
  3022. refreshGroups();
  3023. } else {
  3024. $scope.groupSelector.currentPage = 1;
  3025. }
  3026. };
  3027. $scope.searchGroup = function() {
  3028. if (parseInt($scope.groupSelector.currentPage, 10) === 1) {
  3029. refreshGroups($scope.groupSelector.searchCriteria);
  3030. } else {
  3031. $scope.groupSelector.currentPage = 1;
  3032. }
  3033. };
  3034. $scope.selectGroup = function(selected) {
  3035. if(!selected || selected.id === "realm") return;
  3036. config[configName] = selected.path;
  3037. $modalInstance.close();
  3038. }
  3039. $scope.edit = $scope.selectGroup;
  3040. $scope.cancel = function() {
  3041. $modalInstance.dismiss();
  3042. }
  3043. var isLeaf = function(node) {
  3044. return node.id !== "realm" && (!node.subGroups || node.subGroups.length === 0);
  3045. };
  3046. $scope.getGroupClass = function(node) {
  3047. if (node.id === "realm") {
  3048. return 'pficon pficon-users';
  3049. }
  3050. if (isLeaf(node)) {
  3051. return 'normal';
  3052. }
  3053. if (node.subGroups.length && node.collapsed) return 'collapsed';
  3054. if (node.subGroups.length && !node.collapsed) return 'expanded';
  3055. return 'collapsed';
  3056. };
  3057. $scope.getSelectedClass = function(node) {
  3058. if (node.selected) {
  3059. return 'selected';
  3060. }
  3061. return undefined;
  3062. }
  3063. });
  3064. module.controller('ProviderConfigCtrl', function ($modal, $scope, $route, ComponentUtils, Client) {
  3065. clientSelectControl($scope, $route.current.params.realm, Client);
  3066. $scope.fileNames = {};
  3067. $scope.newMapEntries = {};
  3068. var cachedMaps = {};
  3069. var cachedParsedMaps = {};
  3070. var focusMapValueId = null;
  3071. // KEYCLOAK-4463
  3072. $scope.initEditor = function(editor){
  3073. editor.$blockScrolling = Infinity; // suppress warning message
  3074. };
  3075. $scope.initSelectedClient = function(configName, config) {
  3076. if(config[configName]) {
  3077. $scope.selectedClient = null;
  3078. Client.query({realm: $route.current.params.realm, search: false, clientId: config[configName], max: 1}, function(data) {
  3079. if(data.length > 0) {
  3080. $scope.selectedClient = angular.copy(data[0]);
  3081. $scope.selectedClient.text = $scope.selectedClient.clientId;
  3082. }
  3083. });
  3084. }
  3085. }
  3086. $scope.openRoleSelector = function (configName, config) {
  3087. $modal.open({
  3088. templateUrl: resourceUrl + '/partials/modal/role-selector.html',
  3089. controller: 'RoleSelectorModalCtrl',
  3090. resolve: {
  3091. realm: function () {
  3092. return $scope.realm;
  3093. },
  3094. config: function () {
  3095. return config;
  3096. },
  3097. configName: function () {
  3098. return configName;
  3099. }
  3100. }
  3101. })
  3102. }
  3103. $scope.openGroupSelector = function (configName, config) {
  3104. $modal.open({
  3105. templateUrl: resourceUrl + '/partials/modal/group-selector.html',
  3106. controller: 'GroupSelectorModalCtrl',
  3107. resolve: {
  3108. realm: function () {
  3109. return $scope.realm;
  3110. },
  3111. config: function () {
  3112. return config;
  3113. },
  3114. configName: function () {
  3115. return configName;
  3116. }
  3117. }
  3118. })
  3119. }
  3120. $scope.changeClient = function(configName, config, client, multivalued) {
  3121. if (!client || !client.id) {
  3122. config[configName] = null;
  3123. $scope.selectedClient = null;
  3124. return;
  3125. }
  3126. $scope.selectedClient = client;
  3127. if (multivalued) {
  3128. config[configName][0] = client.clientId;
  3129. } else {
  3130. config[configName] = client.clientId;
  3131. }
  3132. };
  3133. ComponentUtils.convertAllMultivaluedStringValuesToList($scope.properties, $scope.config);
  3134. ComponentUtils.addLastEmptyValueToMultivaluedLists($scope.properties, $scope.config);
  3135. $scope.addValueToMultivalued = function(optionName) {
  3136. var configProperty = $scope.config[optionName];
  3137. var lastIndex = configProperty.length - 1;
  3138. var lastValue = configProperty[lastIndex];
  3139. console.log("Option=" + optionName + ", lastIndex=" + lastIndex + ", lastValue=" + lastValue);
  3140. if (lastValue.length > 0) {
  3141. configProperty.push('');
  3142. }
  3143. }
  3144. $scope.deleteValueFromMultivalued = function(optionName, index) {
  3145. $scope.config[optionName].splice(index, 1);
  3146. }
  3147. $scope.uploadFile = function($files, optionName, config) {
  3148. var reader = new FileReader();
  3149. reader.onload = function(e) {
  3150. $scope.$apply(function() {
  3151. config[optionName][0] = e.target.result;
  3152. });
  3153. };
  3154. reader.readAsText($files[0]);
  3155. $scope.fileNames[optionName] = $files[0].name;
  3156. }
  3157. $scope.addMapEntry = function(optionName) {
  3158. $scope.removeMapEntry(optionName, $scope.newMapEntries[optionName].key)
  3159. var parsedMap = JSON.parse($scope.config[optionName]);
  3160. parsedMap.push($scope.newMapEntries[optionName]);
  3161. $scope.config[optionName] = JSON.stringify(parsedMap);
  3162. delete $scope.newMapEntries[optionName];
  3163. }
  3164. $scope.removeMapEntry = function(optionName, key) {
  3165. var parsedMap = JSON.parse($scope.config[optionName]);
  3166. for(var i = parsedMap.length - 1; i >= 0; i--) {
  3167. if(parsedMap[i]['key'] === key) {
  3168. parsedMap.splice(i, 1);
  3169. }
  3170. }
  3171. $scope.config[optionName] = JSON.stringify(parsedMap);
  3172. }
  3173. $scope.updateMapEntry = function(optionName, key, value) {
  3174. var parsedMap = JSON.parse($scope.config[optionName]);
  3175. for(var i = parsedMap.length - 1; i >= 0; i--) {
  3176. if(parsedMap[i]['key'] === key) {
  3177. parsedMap[i]['value'] = value;
  3178. }
  3179. }
  3180. $scope.config[optionName] = JSON.stringify(parsedMap);
  3181. focusMapValueId = "mapValue-" + optionName + "-" + key;
  3182. }
  3183. $scope.jsonParseMap = function(optionName) {
  3184. if(cachedParsedMaps[optionName] === undefined) {
  3185. cachedMaps[optionName] = "[]";
  3186. cachedParsedMaps[optionName] = [];
  3187. if(!$scope.config.hasOwnProperty(optionName)){
  3188. $scope.config[optionName]=cachedMaps[optionName];
  3189. } else {
  3190. cachedMaps[optionName] = $scope.config[optionName];
  3191. cachedParsedMaps[optionName] = JSON.parse(cachedMaps[optionName]);
  3192. }
  3193. }
  3194. var mapChanged = $scope.config[optionName] !== cachedMaps[optionName];
  3195. if(mapChanged){
  3196. cachedMaps[optionName] = $scope.config[optionName];
  3197. cachedParsedMaps[optionName] = JSON.parse(cachedMaps[optionName]);
  3198. }
  3199. if(!mapChanged && focusMapValueId !== null){
  3200. document.getElementById(focusMapValueId).focus();
  3201. focusMapValueId = null;
  3202. }
  3203. return cachedParsedMaps[optionName];
  3204. }
  3205. });
  3206. module.directive('kcProviderConfig', function ($modal) {
  3207. return {
  3208. scope: {
  3209. config: '=',
  3210. properties: '=',
  3211. realm: '=',
  3212. clients: '=',
  3213. configName: '='
  3214. },
  3215. restrict: 'E',
  3216. replace: true,
  3217. controller: 'ProviderConfigCtrl',
  3218. templateUrl: resourceUrl + '/templates/kc-provider-config.html'
  3219. }
  3220. });
  3221. module.controller('ComponentRoleSelectorModalCtrl', function($scope, realm, config, configName, RealmRoles, Client, ClientRole, $modalInstance) {
  3222. $scope.selectedRealmRole = {
  3223. role: undefined
  3224. };
  3225. $scope.selectedClientRole = {
  3226. role: undefined
  3227. };
  3228. $scope.client = {
  3229. selected: undefined
  3230. };
  3231. $scope.selectRealmRole = function() {
  3232. config[configName][0] = $scope.selectedRealmRole.role.name;
  3233. $modalInstance.close();
  3234. }
  3235. $scope.selectClientRole = function() {
  3236. config[configName][0] = $scope.client.selected.clientId + "." + $scope.selectedClientRole.role.name;
  3237. $modalInstance.close();
  3238. }
  3239. $scope.cancel = function() {
  3240. $modalInstance.dismiss();
  3241. }
  3242. $scope.changeClient = function() {
  3243. if ($scope.client.selected) {
  3244. ClientRole.query({realm: realm.realm, client: $scope.client.selected.id}, function (data) {
  3245. $scope.clientRoles = data;
  3246. });
  3247. } else {
  3248. console.log('selected client was null');
  3249. $scope.clientRoles = null;
  3250. }
  3251. }
  3252. RealmRoles.query({realm: realm.realm}, function(data) {
  3253. $scope.realmRoles = data;
  3254. })
  3255. Client.query({realm: realm.realm}, function(data) {
  3256. $scope.clients = data;
  3257. if (data.length > 0) {
  3258. $scope.client.selected = data[0];
  3259. $scope.changeClient();
  3260. }
  3261. })
  3262. });
  3263. module.controller('ComponentConfigCtrl', function ($modal, $scope, $route, Client) {
  3264. $scope.initSelectedClient = function(configName, config) {
  3265. if(config[configName]) {
  3266. $scope.selectedClient = null;
  3267. Client.query({realm: $route.current.params.realm, search: false, clientId: config[configName], max: 1}, function(data) {
  3268. if(data.length > 0) {
  3269. $scope.selectedClient = angular.copy(data[0]);
  3270. $scope.selectedClient.text = $scope.selectedClient.clientId;
  3271. }
  3272. });
  3273. }
  3274. }
  3275. $scope.changeClient = function(configName, config, client) {
  3276. if (!client || !client.id) {
  3277. config[configName] = null;
  3278. $scope.selectedClient = null;
  3279. return;
  3280. }
  3281. $scope.selectedClient = client;
  3282. config[configName] = client.clientId;
  3283. };
  3284. $scope.openRoleSelector = function (configName, config) {
  3285. $modal.open({
  3286. templateUrl: resourceUrl + '/partials/modal/component-role-selector.html',
  3287. controller: 'ComponentRoleSelectorModalCtrl',
  3288. resolve: {
  3289. realm: function () {
  3290. return $scope.realm;
  3291. },
  3292. config: function () {
  3293. return config;
  3294. },
  3295. configName: function () {
  3296. return configName;
  3297. }
  3298. }
  3299. })
  3300. }
  3301. });
  3302. module.directive('kcComponentConfig', function ($modal) {
  3303. return {
  3304. scope: {
  3305. config: '=',
  3306. properties: '=',
  3307. realm: '=',
  3308. clients: '=',
  3309. configName: '='
  3310. },
  3311. restrict: 'E',
  3312. replace: true,
  3313. controller: 'ComponentConfigCtrl',
  3314. templateUrl: resourceUrl + '/templates/kc-component-config.html'
  3315. }
  3316. });
  3317. /*
  3318. * Used to select the element (invoke $(elem).select()) on specified action list.
  3319. * Usages kc-select-action="click mouseover"
  3320. * When used in the textarea element, this will select/highlight the textarea content on specified action (i.e. click).
  3321. */
  3322. module.directive('kcSelectAction', function ($compile, Notifications) {
  3323. return {
  3324. restrict: 'A',
  3325. compile: function (elem, attrs) {
  3326. var events = attrs.kcSelectAction.split(" ");
  3327. for(var i=0; i < events.length; i++){
  3328. elem.bind(events[i], function(){
  3329. elem.select();
  3330. });
  3331. }
  3332. }
  3333. }
  3334. });
  3335. module.filter('remove', function() {
  3336. return function(input, remove, attribute) {
  3337. if (!input || !remove) {
  3338. return input;
  3339. }
  3340. var out = [];
  3341. for ( var i = 0; i < input.length; i++) {
  3342. var e = input[i];
  3343. if (Array.isArray(remove)) {
  3344. for (var j = 0; j < remove.length; j++) {
  3345. if (attribute) {
  3346. if (remove[j][attribute] == e[attribute]) {
  3347. e = null;
  3348. break;
  3349. }
  3350. } else {
  3351. if (remove[j] == e) {
  3352. e = null;
  3353. break;
  3354. }
  3355. }
  3356. }
  3357. } else {
  3358. if (attribute) {
  3359. if (remove[attribute] == e[attribute]) {
  3360. e = null;
  3361. }
  3362. } else {
  3363. if (remove == e) {
  3364. e = null;
  3365. }
  3366. }
  3367. }
  3368. if (e != null) {
  3369. out.push(e);
  3370. }
  3371. }
  3372. return out;
  3373. };
  3374. });
  3375. module.filter('capitalize', function() {
  3376. return function(input) {
  3377. if (!input) {
  3378. return;
  3379. }
  3380. var splittedWords = input.split(/\s+/);
  3381. for (var i=0; i<splittedWords.length ; i++) {
  3382. splittedWords[i] = splittedWords[i].charAt(0).toUpperCase() + splittedWords[i].slice(1);
  3383. };
  3384. return splittedWords.join(" ");
  3385. };
  3386. });
  3387. /*
  3388. * Guarantees a deterministic property iteration order.
  3389. * See: http://www.2ality.com/2015/10/property-traversal-order-es6.html
  3390. */
  3391. module.filter('toOrderedMapSortedByKey', function(){
  3392. return function(input){
  3393. if(!input){
  3394. return input;
  3395. }
  3396. var keys = Object.keys(input);
  3397. if(keys.length <= 1){
  3398. return input;
  3399. }
  3400. keys.sort();
  3401. var result = {};
  3402. for (var i = 0; i < keys.length; i++) {
  3403. result[keys[i]] = input[keys[i]];
  3404. }
  3405. return result;
  3406. };
  3407. });
  3408. module.directive('kcSidebarResize', function ($window) {
  3409. return function (scope, element) {
  3410. function resize() {
  3411. var navBar = angular.element(document.getElementsByClassName('navbar-pf')).height();
  3412. var container = angular.element(document.getElementById("view").getElementsByTagName("div")[0]).height();
  3413. var height = Math.max(container, window.innerHeight - navBar - 3);
  3414. element[0].style['min-height'] = height + 'px';
  3415. }
  3416. resize();
  3417. var w = angular.element($window);
  3418. scope.$watch(function () {
  3419. return {
  3420. 'h': window.innerHeight,
  3421. 'w': window.innerWidth
  3422. };
  3423. }, function () {
  3424. resize();
  3425. }, true);
  3426. w.bind('resize', function () {
  3427. scope.$apply();
  3428. });
  3429. }
  3430. });
  3431. module.directive('kcTooltip', function($compile) {
  3432. return {
  3433. restrict: 'E',
  3434. replace: false,
  3435. terminal: true,
  3436. priority: 1000,
  3437. link: function link(scope,element, attrs) {
  3438. var angularElement = angular.element(element[0]);
  3439. var tooltip = angularElement.text();
  3440. angularElement.text('');
  3441. element.addClass('hidden');
  3442. var label = angular.element(element.parent().children()[0]);
  3443. label.append(' <i class="fa fa-question-circle text-muted" tooltip="' + tooltip + '" tooltip-placement="right" tooltip-trigger="mouseover mouseout"></i>');
  3444. $compile(label)(scope);
  3445. }
  3446. };
  3447. });
  3448. module.directive( 'kcOpen', function ( $location ) {
  3449. return function ( scope, element, attrs ) {
  3450. var path;
  3451. attrs.$observe( 'kcOpen', function (val) {
  3452. path = val;
  3453. });
  3454. element.bind( 'click', function () {
  3455. scope.$apply( function () {
  3456. $location.path(path);
  3457. });
  3458. });
  3459. };
  3460. });
  3461. module.directive('kcOnReadFile', function ($parse) {
  3462. console.debug('kcOnReadFile');
  3463. return {
  3464. restrict: 'A',
  3465. scope: false,
  3466. link: function(scope, element, attrs) {
  3467. var fn = $parse(attrs.kcOnReadFile);
  3468. element.on('change', function(onChangeEvent) {
  3469. var reader = new FileReader();
  3470. reader.onload = function(onLoadEvent) {
  3471. scope.$apply(function() {
  3472. fn(scope, {$fileContent:onLoadEvent.target.result});
  3473. });
  3474. };
  3475. reader.readAsText((onChangeEvent.srcElement || onChangeEvent.target).files[0]);
  3476. });
  3477. }
  3478. };
  3479. });
  3480. module.controller('PagingCtrl', function ($scope) {
  3481. $scope.currentPageInput = 1;
  3482. $scope.firstPage = function() {
  3483. if (!$scope.hasPrevious()) return;
  3484. $scope.currentPage = 1;
  3485. $scope.currentPageInput = 1;
  3486. };
  3487. $scope.lastPage = function() {
  3488. if (!$scope.hasNext()) return;
  3489. $scope.currentPage = $scope.numberOfPages;
  3490. $scope.currentPageInput = $scope.numberOfPages;
  3491. };
  3492. $scope.previousPage = function() {
  3493. if (!$scope.hasPrevious()) return;
  3494. $scope.currentPage--;
  3495. $scope.currentPageInput = $scope.currentPage;
  3496. };
  3497. $scope.nextPage = function() {
  3498. if (!$scope.hasNext()) return;
  3499. $scope.currentPage++;
  3500. $scope.currentPageInput = $scope.currentPage;
  3501. };
  3502. $scope.hasNext = function() {
  3503. return $scope.currentPage < $scope.numberOfPages;
  3504. };
  3505. $scope.hasPrevious = function() {
  3506. return $scope.currentPage > 1;
  3507. };
  3508. });
  3509. // Provides a component for injection with utility methods for manipulating strings
  3510. module.factory('KcStrings', function () {
  3511. var instance = {};
  3512. // some IE versions do not support string.endsWith method, this method should be used as an alternative for cross-browser compatibility
  3513. instance.endsWith = function(source, suffix) {
  3514. return source.indexOf(suffix, source.length - suffix.length) !== -1;
  3515. };
  3516. return instance;
  3517. });
  3518. module.directive('kcPaging', function () {
  3519. return {
  3520. scope: {
  3521. currentPage: '=',
  3522. currentPageInput: '=',
  3523. numberOfPages: '='
  3524. },
  3525. restrict: 'E',
  3526. replace: true,
  3527. controller: 'PagingCtrl',
  3528. templateUrl: resourceUrl + '/templates/kc-paging.html'
  3529. }
  3530. });
  3531. // Tests the page number input from currentPageInput to see
  3532. // if it represents a valid page. If so, the current page is changed.
  3533. module.directive('kcValidPage', function() {
  3534. return {
  3535. require: 'ngModel',
  3536. link: function(scope, element, attrs, ctrl) {
  3537. ctrl.$validators.inRange = function(modelValue, viewValue) {
  3538. if (viewValue >= 1 && viewValue <= scope.numberOfPages) {
  3539. scope.currentPage = viewValue;
  3540. }
  3541. return true;
  3542. }
  3543. }
  3544. }
  3545. });
  3546. // Directive to parse/format strings into numbers
  3547. module.directive('stringToNumber', function() {
  3548. return {
  3549. require: 'ngModel',
  3550. link: function(scope, element, attrs, ngModel) {
  3551. ngModel.$parsers.push(function(value) {
  3552. return (typeof value === 'undefined' || value === null)? '' : '' + value;
  3553. });
  3554. ngModel.$formatters.push(function(value) {
  3555. return parseFloat(value);
  3556. });
  3557. }
  3558. };
  3559. });
  3560. // filter used for paged tables
  3561. module.filter('startFrom', function () {
  3562. return function (input, start) {
  3563. if (input) {
  3564. start = +start;
  3565. return input.slice(start);
  3566. }
  3567. return [];
  3568. };
  3569. });
  3570. module.directive('kcPassword', function ($compile, Notifications) {
  3571. return {
  3572. restrict: 'A',
  3573. link: function ($scope, elem, attr, ctrl) {
  3574. function toggleMask(evt) {
  3575. if(elem.hasClass('password-conceal')) {
  3576. view();
  3577. } else {
  3578. conceal();
  3579. }
  3580. }
  3581. function view() {
  3582. elem.removeClass('password-conceal');
  3583. var t = elem.next().children().first();
  3584. t.addClass('fa-eye-slash');
  3585. t.removeClass('fa-eye');
  3586. }
  3587. function conceal() {
  3588. elem.addClass('password-conceal');
  3589. var t = elem.next().children().first();
  3590. t.removeClass('fa-eye-slash');
  3591. t.addClass('fa-eye');
  3592. }
  3593. elem.addClass("password-conceal");
  3594. elem.attr("type","text");
  3595. elem.attr("autocomplete", "off");
  3596. var p = elem.parent();
  3597. var inputGroup = $('<div class="input-group"></div>');
  3598. var eye = $('<span class="input-group-addon btn btn-default"><span class="fa fa-eye"></span></span>')
  3599. .on('click', toggleMask);
  3600. $scope.$watch(attr.ngModel, function(v) {
  3601. if (v && v == '**********') {
  3602. elem.next().addClass('disabled')
  3603. } else if (v && v.indexOf('${v') == 0) {
  3604. elem.next().addClass('disabled')
  3605. view();
  3606. } else {
  3607. elem.next().removeClass('disabled')
  3608. }
  3609. })
  3610. elem.detach().appendTo(inputGroup);
  3611. inputGroup.append(eye);
  3612. p.append(inputGroup);
  3613. }
  3614. }
  3615. });
  3616. module.filter('resolveClientRootUrl', function() {
  3617. return function(input) {
  3618. if (!input) {
  3619. return;
  3620. }
  3621. return input.replace("${authBaseUrl}", authServerUrl).replace("${authAdminUrl}", authUrl);
  3622. };
  3623. });