client-scopes-evaluate.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <!--
  2. ~ Copyright 2017 Red Hat, Inc. and/or its affiliates
  3. ~ and other contributors as indicated by the @author tags.
  4. ~
  5. ~ Licensed under the Apache License, Version 2.0 (the "License");
  6. ~ you may not use this file except in compliance with the License.
  7. ~ You may obtain a copy of the License at
  8. ~
  9. ~ http://www.apache.org/licenses/LICENSE-2.0
  10. ~
  11. ~ Unless required by applicable law or agreed to in writing, software
  12. ~ distributed under the License is distributed on an "AS IS" BASIS,
  13. ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ~ See the License for the specific language governing permissions and
  15. ~ limitations under the License.
  16. -->
  17. <div class="col-sm-9 col-md-10 col-sm-push-3 col-md-push-2">
  18. <ol class="breadcrumb">
  19. <li><a href="#/realms/{{realm.realm}}/clients">{{:: 'clients' | translate}}</a></li>
  20. <li>{{client.clientId}}</li>
  21. </ol>
  22. <kc-tabs-client></kc-tabs-client>
  23. <ul class="nav nav-tabs nav-tabs-pf">
  24. <li>
  25. <a href="#/realms/{{realm.realm}}/clients/{{client.id}}/client-scopes/setup-scopes">{{:: 'client-scopes.setup' | translate}}</a>
  26. <kc-tooltip>{{:: 'client-scopes.setup.tooltip' | translate}}</kc-tooltip>
  27. </li>
  28. <li class="active">
  29. <a href="#/realms/{{realm.realm}}/clients/{{client.id}}/client-scopes/evaluate-scopes">{{:: 'client-scopes.evaluate' | translate}}</a>
  30. <kc-tooltip>{{:: 'client-scopes.evaluate.tooltip' | translate}}</kc-tooltip>
  31. </li>
  32. </ul>
  33. <form class="form-horizontal" name="evaluateForm" novalidate kc-read-only="!access.viewClients">
  34. <fieldset>
  35. <div class="form-group clearfix" data-ng-show="client.protocol == 'openid-connect'">
  36. <label class="col-md-2 control-label" for="scopeParam">{{:: 'scope-parameter' | translate}}</label>
  37. <div class="col-md-6">
  38. <input class="form-control" id="scopeParam" type="text" value="{{scopeParam}}" readonly kc-select-action="click">
  39. </div>
  40. <kc-tooltip>{{:: 'scope-parameter.tooltip' | translate}}</kc-tooltip>
  41. </div>
  42. </fieldset>
  43. <div class="form-group">
  44. <label class="col-md-2 control-label" class="control-label">{{:: 'client-scopes.evaluate.scopes' | translate}}</label>
  45. <kc-tooltip>{{:: 'client-scopes.evaluate.scopes.tooltip' | translate}}</kc-tooltip>
  46. <div class="col-md-10">
  47. <div class="row">
  48. <div class="col-md-4">
  49. <label class="control-label" for="available">{{:: 'client-scopes.evaluate.scopes.available' | translate}}</label>
  50. <kc-tooltip>{{:: 'client-scopes.evaluate.scopes.available.tooltip' | translate}}</kc-tooltip>
  51. <select id="available" class="form-control overflow-select" multiple size="5"
  52. ng-multiple="true"
  53. ng-model="selectedClientScopes">
  54. <option ng-repeat="r in availableClientScopes | orderBy:'name'"
  55. value="{{r}}" title="{{r.name}}">
  56. {{r.name}}
  57. </option>
  58. </select>
  59. <button ng-disabled="selectedClientScopes.length == 0" class="btn btn-default" type="submit" ng-click="addAppliedClientScope()">
  60. {{:: 'add-selected' | translate}} <i class="fa fa-angle-double-right"></i>
  61. </button>
  62. </div>
  63. <div class="col-md-4">
  64. <label class="control-label" for="assigned">{{:: 'client-scopes.evaluate.scopes.assigned' | translate}}</label>
  65. <kc-tooltip>{{:: 'client-scopes.evaluate.scopes.assigned.tooltip' | translate}}</kc-tooltip>
  66. <select id="assigned" class="form-control overflow-select" multiple size=5
  67. ng-multiple="true"
  68. ng-model="selectedDefClientScopes">
  69. <option ng-repeat="r in assignedClientScopes | orderBy:'name'"
  70. value="{{r}}" title="{{r.name}}">
  71. {{r.name}}
  72. </option>
  73. </select>
  74. <button ng-disabled="selectedDefClientScopes.length == 0" class="btn btn-default" type="submit" ng-click="deleteAppliedClientScope()">
  75. <i class="fa fa-angle-double-left"></i> {{:: 'remove-selected' | translate}}
  76. </button>
  77. </div>
  78. <div class="col-md-4">
  79. <label class="control-label" for="assigned">{{:: 'client-scopes.evaluate.scopes.effective' | translate}}</label>
  80. <kc-tooltip>{{:: 'client-scopes.evaluate.scopes.effective.tooltip' | translate}}</kc-tooltip>
  81. <select id="effective" class="form-control overflow-select" multiple size=5
  82. disabled="true"
  83. ng-model="dummymodel">
  84. <option ng-repeat="r in effectiveClientScopes | orderBy:'name'"
  85. value="{{r}}" title="{{r.name}}">
  86. {{r.name}}
  87. </option>
  88. </select>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="form-group clearfix" data-ng-show="access.viewUsers">
  94. <label class="col-md-2 control-label" for="users">{{:: 'user' | translate}}</label>
  95. <div class="col-md-6">
  96. <input type="hidden" ui-select2="usersUiSelect" id="users" data-ng-model="selectedUser" data-ng-change="selectUser(selectedUser);" data-placeholder="{{:: 'authz-select-user' | translate}}...">
  97. </input>
  98. </div>
  99. <kc-tooltip>{{:: 'client-scopes.evaluate.user.tooltip' | translate}}</kc-tooltip>
  100. </div>
  101. <div class="form-group clearfix">
  102. <div class="col-md-10 col-md-offset-1" data-ng-show="client.access.view">
  103. <button type="submit" data-ng-click="sendEvaluationRequest()" class="btn btn-primary" tooltip-trigger="mouseover mouseout" tooltip="{{:: 'send-evaluation-request.tooltip' | translate}}" tooltip-placement="bottom">{{:: 'send-evaluation-request' | translate}}</button>
  104. </div>
  105. </div>
  106. </form>
  107. <ul class="nav nav-tabs nav-tabs-pf" data-ng-show="isResponseAvailable()">
  108. <li class="{{tabCss.tab1}}" data-ng-click="showTab(1)">
  109. <a href="">{{:: 'evaluated-protocol-mappers' | translate}}</a>
  110. <kc-tooltip>{{:: 'evaluated-protocol-mappers.tooltip' | translate}}</kc-tooltip>
  111. </li>
  112. <li class="{{tabCss.tab2}}" data-ng-click="showTab(2)">
  113. <a href="">{{:: 'evaluated-roles' | translate}}</a>
  114. <kc-tooltip>{{:: 'evaluated-roles.tooltip' | translate}}</kc-tooltip>
  115. </li>
  116. <li class="{{tabCss.tab3}}" data-ng-click="showTab(3)" data-ng-show="isAccessTokenAvailable()">
  117. <a href="">{{:: 'generated-access-token' | translate}}</a>
  118. <kc-tooltip>{{:: 'generated-access-token.tooltip' | translate}}</kc-tooltip>
  119. </li>
  120. <li class="{{tabCss.tab4}}" data-ng-click="showTab(4)" data-ng-show="isIDTokenAvailable()">
  121. <a href="">{{:: 'generated-id-token' | translate}}</a>
  122. <kc-tooltip>{{:: 'generated-id-token.tooltip' | translate}}</kc-tooltip>
  123. </li>
  124. <li class="{{tabCss.tab5}}" data-ng-click="showTab(5)" data-ng-show="isUserInfoAvailable()">
  125. <a href="">{{:: 'generated-user-info' | translate}}</a>
  126. <kc-tooltip>{{:: 'generated-user-info.tooltip' | translate}}</kc-tooltip>
  127. </li>
  128. </ul>
  129. <!-- Effective protocol mappers -->
  130. <table class="table table-striped table-bordered" data-ng-show="protocolMappersShown()">
  131. <thead>
  132. <tr>
  133. <th class="kc-table-actions" colspan="4">
  134. <div class="form-inline">
  135. <div>
  136. <div class="input-group">
  137. <input type="text" placeholder="{{:: 'search.placeholder' | translate}}" data-ng-model="search.mapperName" class="form-control search" onkeyup="if(event.keyCode == 13){$(this).next('I').click();}">
  138. <div class="input-group-addon">
  139. <i class="fa fa-search" type="submit"></i>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. </th>
  145. </tr>
  146. <tr data-ng-hide="protocolMappers.length == 0">
  147. <th>{{:: 'name' | translate}}</th>
  148. <th>{{:: 'parent-client-scope' | translate}}</th>
  149. <th>{{:: 'category' | translate}}</th>
  150. <th>{{:: 'type' | translate}}</th>
  151. <th>{{:: 'priority-order' | translate}}</th>
  152. </tr>
  153. </thead>
  154. <tbody>
  155. <tr ng-repeat="mapper in protocolMappers | filter:search | orderBy:sortMappersByPriority">
  156. <td><a href="#/realms/{{realm.realm}}/{{mapper.containerType}}s/{{mapper.containerId}}/mappers/{{mapper.mapperId}}">{{mapper.mapperName}}</a></td>
  157. <td><a href="#/realms/{{realm.realm}}/{{mapper.containerType}}s/{{mapper.containerId}}">{{mapper.containerName}}</a></td>
  158. <td>{{mapperTypes[mapper.protocolMapper].category}}</td>
  159. <td>{{mapperTypes[mapper.protocolMapper].name}}</td>
  160. <td>{{mapperTypes[mapper.protocolMapper].priority}}</td>
  161. </tr>
  162. <tr data-ng-show="mappers.length == 0">
  163. <td>{{:: 'no-mappers-available' | translate}}</td>
  164. </tr>
  165. </tbody>
  166. </table>
  167. <!-- Effective role scope mappings -->
  168. <form class="form-horizontal" name="realmForm" novalidate kc-read-only="!access.viewClients">
  169. <div class="form-group" data-ng-show="rolesShown()">
  170. <label class="col-md-2 control-label" class="control-label">{{:: 'realm-roles' | translate}}</label>
  171. <div class="col-md-10">
  172. <div class="row">
  173. <div class="col-md-4">
  174. <label class="control-label" for="available-realm-roles">{{:: 'client-scopes.evaluate.not-granted-roles' | translate}}</label>
  175. <kc-tooltip>{{:: 'client-scopes.evaluate.not-granted-roles.tooltip' | translate}}</kc-tooltip>
  176. <select id="available-realm-roles" class="form-control overflow-select" multiple size="5"
  177. disabled="true"
  178. ng-model="dummymodel1">
  179. <option ng-repeat="r in notGrantedRealmRoles | orderBy:'name'"
  180. value="{{r}}" title="{{r.name}}">
  181. {{r.name}}
  182. </option>
  183. </select>
  184. </div>
  185. <div class="col-md-4">
  186. <label class="control-label" for="realm-composite">{{:: 'client-scopes.evaluate.granted-realm-effective-roles' | translate}} </label>
  187. <kc-tooltip>{{:: 'client-scopes.evaluate.granted-realm-effective-roles.tooltip' | translate}}</kc-tooltip>
  188. <select id="realm-composite" class="form-control overflow-select" multiple size=5
  189. disabled="true"
  190. ng-model="dummymodel2">
  191. <option ng-repeat="r in grantedRealmRoles | orderBy:'name'"
  192. value="{{r}}" title="{{r.name}}">
  193. {{r.name}}
  194. </option>
  195. </select>
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. <div class="form-group" data-ng-show="rolesShown()">
  201. <label class="col-md-2 control-label" for="clients">{{:: 'client-roles' | translate}}</label>
  202. <div class="col-md-6">
  203. <input type="hidden" ui-select2="clientsUiSelect" id="clients" data-ng-model="selectedClient" data-ng-change="selectClient(selectedClient);" data-placeholder="{{:: 'authz-select-client' | translate}}...">
  204. </input>
  205. </div>
  206. <div class="col-md-10 col-md-offset-2">
  207. <div class="row" data-ng-show="selectedClient">
  208. <div class="col-md-4">
  209. <label class="control-label" for="available-client">{{:: 'client-scopes.evaluate.not-granted-roles' | translate}}</label>
  210. <kc-tooltip>{{:: 'client-scopes.evaluate.not-granted-roles.tooltip' | translate}}</kc-tooltip>
  211. <select id="available-client" class="form-control overflow-select" multiple size="5"
  212. disabled="true"
  213. ng-model="dummymodel">
  214. <option ng-repeat="r in notGrantedClientRoles | orderBy:'name'"
  215. value="{{r}}" title="{{r.name}}">
  216. {{r.name}}
  217. </option>
  218. </select>
  219. </div>
  220. <div class="col-md-4">
  221. <label class="control-label" for="client-composite">{{:: 'client-scopes.evaluate.granted-client-effective-roles' | translate}}</label>
  222. <kc-tooltip>{{:: 'client-scopes.evaluate.granted-realm-effective-roles.tooltip' | translate}}</kc-tooltip>
  223. <select id="client-composite" class="form-control overflow-select" multiple size=5
  224. disabled="true"
  225. ng-model="dummymodel">
  226. <option ng-repeat="r in grantedClientRoles | orderBy:'name'"
  227. value="{{r}}" title="{{r.name}}">
  228. {{r.name}}
  229. </option>
  230. </select>
  231. </div>
  232. </div>
  233. </div>
  234. </div>
  235. </form>
  236. <!-- Example content: One of Access token, ID token or User Info -->
  237. <form class="form-horizontal" name="realmForm" novalidate kc-read-only="!access.viewClients" data-ng-show="exampleTabInfo().isShown">
  238. <div class="form-group">
  239. <div class="col-md-10 col-md-offset-1">
  240. <textarea class="form-control" rows="20" kc-select-action="click" readonly>{{exampleTabInfo().value}}</textarea>
  241. </div>
  242. </div>
  243. </form>
  244. </div>
  245. <kc-menu></kc-menu>