Well... If this is a necessary feature and you still haven't come up with a solution, here an idea that might helps you. (I think unauthorizedRedirectUrl is for other use case, hence not working, as you have tested)
Any time user have this error "Service access denied due to missing privileges", they will show an error on page. So it might be possible to use Thymeleaf tricks to redirect user.
Note: The below method is not good code, but this is the only simple solution I have think of off the top of my head.
==================================Below code are not tested============================================
classpath:/templates/casLoginView.hrml (inside <head> should be fine):
<!-- th:block does not leave trace for users-->
<th:block th:if="${#fields.hasErrors('*')}">
<th:block th:each="err : ${#fields.errors('*')}" ><!--Loop through errors-->
<script th:inline="javascript" th:if="${#fields.hasErrors('*') == @environment.getProperty('authenticationFailure.UnauthorizedServiceForPrincipalException')}">
</script>
</th:block>
</th:block>
If you want a more elegant solution, then you might look into modifying the java code.... However, it might be more tedious.
- Andy