spring security for keycloak roles

This commit is contained in:
Jörg Henke
2023-08-04 19:16:18 +02:00
parent e7058a8b02
commit 485bc5e8c3
15 changed files with 98 additions and 43 deletions

View File

@ -41,18 +41,6 @@
th:text="${sum.getBillingTime(null)}" class="distfat"></span>
</div>
</div>
<!-- for debugging only, set display to block -->
<div class="card" style="display: none">
<div class="card-body">
<span th:text="${#authentication.principal.attributes['resource_access']['timetrack']['roles']}"></span><br />
<span th:if="${#authentication.principal.attributes['resource_access']['timetrack']['roles'].contains('timetrack_user')}">role timetrack_user found directly</span><br />
<span sec:authorize="hasRole('timetrack_user')" style="color: green">well done</span>
<span sec:authorize="!hasRole('timetrack_user')" style="color: rgb(165, 29, 45)">role timetrack_user not yet detected</span>
<br />
<span>found roles:</span><br />
<span th:each="r : ${#authentication.principal.attributes['resource_access']['timetrack']['roles']}" th:if="${r}" th:text="${r + ' '}" style="color: royalblue"></span>
</div>
</div>
</main>
</body>