Changes for page CAS Java klient
Last modified by Petr Abrahamczik on 16.04.2024 10:22
From version 15.1
edited by Petr Abrahamczik
on 07.02.2019 13:47
on 07.02.2019 13:47
Change comment:
Návrat k verzi 13.2
To version 13.1
edited by Petr Abrahamczik
on 07.02.2019 13:43
on 07.02.2019 13:43
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,6 +1,6 @@ 1 1 V ukázkovém příkladu je popsán základní způsob konfigurace webové aplikace v Javě pomocí [[Java Apereo CAS Client>>https://github.com/apereo/java-cas-client]]. Aplikace je schopna získat přihlášeného uživatele pomocí CAS v3 protokolu. 2 2 3 -1. Do webovéaplikace je potřeba přidat knihovny klienta https://mvnrepository.com/artifact/org.jasig.cas.client/cas-client-core buď přímo a nebo pomocí nějakého buildovacího nástroje např. Maven.(((3 +1. Do aplikace je potřeba přidat knihovny klienta https://mvnrepository.com/artifact/org.jasig.cas.client/cas-client-core buď přímo a nebo pomocí nějakého buildovacího nástroje např. Maven.((( 4 4 {{code language="xml"}} 5 5 <dependency> 6 6 <groupId>org.jasig.cas.client</groupId> ... ... @@ -20,7 +20,7 @@ 20 20 <param-name>casServerUrlPrefix</param-name> 21 21 <param-value>https://www.sso.vsb.cz</param-value> 22 22 </init-param> 23 -</filter> 23 +</filter> 24 24 25 25 <filter> 26 26 <filter-name>CAS Authentication Filter</filter-name> ... ... @@ -47,7 +47,7 @@ 47 47 <param-value>https://klient.vsb.cz</param-value> 48 48 </init-param> 49 49 </filter> 50 - 50 + 51 51 <filter> 52 52 <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name> 53 53 <filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class> ... ... @@ -56,13 +56,13 @@ 56 56 <filter> 57 57 <filter-name>CAS Assertion Thread Local Filter</filter-name> 58 58 <filter-class>org.jasig.cas.client.util.AssertionThreadLocalFilter</filter-class> 59 -</filter> 60 - 59 +</filter> 60 + 61 61 <filter-mapping> 62 62 <filter-name>CAS Single Sign Out Filter</filter-name> 63 63 <url-pattern>/*</url-pattern> 64 64 </filter-mapping> 65 - 65 + 66 66 <filter-mapping> 67 67 <filter-name>CAS Authentication Filter</filter-name> 68 68 <url-pattern>/*</url-pattern> ... ... @@ -77,12 +77,12 @@ 77 77 <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name> 78 78 <url-pattern>/*</url-pattern> 79 79 </filter-mapping> 80 - 80 + 81 81 <filter-mapping> 82 82 <filter-name>CAS Assertion Thread Local Filter</filter-name> 83 83 <url-pattern>/*</url-pattern> 84 84 </filter-mapping> 85 - 85 + 86 86 <listener> 87 87 <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class> 88 88 </listener> ... ... @@ -92,71 +92,71 @@ 92 92 ((( 93 93 (% class="code" %) 94 94 ((( 95 -(% style="color:#008000; font-weight:bold" %)##**<filter>**##(%%) 96 -(% style="color:#008000; font-weight:bold" %) ##**<filter-name>**##(%%)##CAS Single Sign Out Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%)97 -(% style="color:#008000; font-weight:bold" %)**<filter-class>**(%%)org.jasig.cas.client.session.SingleSignOutFilter(% style="color:#008000; font-weight:bold" %)**</filter-class>**(%%) 98 -(% style="color:#008000; font-weight:bold" %)**<init-param>**(%%) 99 - (% style="color:#008000; font-weight:bold" %)**<param-name>**(%%)casServerUrlPrefix(% style="color:#008000; font-weight:bold" %)**</param-name>**(%%) 100 - (% style="color:#008000; font-weight:bold" %)**<param-value>**(%%)https:~/~/www.sso.vsb.cz(% style="color:#008000; font-weight:bold" %)**</param-value>**(%%) 101 -(% style="color:#008000; font-weight:bold" %)**</init-param>**(%%) 95 +(% style="color:#008000; font-weight:bold" %)##**<filter>**##(%%)## 96 + (% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Single Sign Out Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 97 + (% style="color:#008000; font-weight:bold" %)**<filter-class>**(%%)org.jasig.cas.client.session.SingleSignOutFilter(% style="color:#008000; font-weight:bold" %)**</filter-class>**(%%) 98 + (% style="color:#008000; font-weight:bold" %)**<init-param>**(%%) 99 + (% style="color:#008000; font-weight:bold" %)**<param-name>**(%%)casServerUrlPrefix(% style="color:#008000; font-weight:bold" %)**</param-name>**(%%) 100 + (% style="color:#008000; font-weight:bold" %)**<param-value>**(%%)https:~/~/www.sso.vsb.cz(% style="color:#008000; font-weight:bold" %)**</param-value>**(%%) 101 + (% style="color:#008000; font-weight:bold" %)**</init-param>**(%%) 102 102 (% style="color:#008000; font-weight:bold" %)**</filter>**(%%) 103 103 \\(% style="color:#008000; font-weight:bold" %)**<filter>**(%%) 104 -(% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Authentication Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 105 -(% style="color:#008000; font-weight:bold" %)**<filter-class>**(%%)org.jasig.cas.client.authentication.AuthenticationFilter(% style="color:#008000; font-weight:bold" %)**</filter-class>**(%%) 106 -(% style="color:#008000; font-weight:bold" %)**<init-param>**(%%) 107 - (% style="color:#008000; font-weight:bold" %)**<param-name>**(%%)casServerUrlPrefix(% style="color:#008000; font-weight:bold" %)**</param-name>**(%%) 108 - (% style="color:#008000; font-weight:bold" %)**<param-value>**(%%)https:~/~/www.sso.vsb.cz(% style="color:#008000; font-weight:bold" %)**</param-value>**(%%) 109 -(% style="color:#008000; font-weight:bold" %)**</init-param>**(%%) 110 -(% style="color:#008000; font-weight:bold" %)**<init-param>**(%%) 111 - (% style="color:#008000; font-weight:bold" %)**<param-name>**(%%)serverName(% style="color:#008000; font-weight:bold" %)**</param-name>**(%%) 112 - (% style="color:#008000; font-weight:bold" %)**<param-value>**(%%)https:~/~/klient.vsb.cz(% style="color:#008000; font-weight:bold" %)**</param-value>**(%%) 113 -(% style="color:#008000; font-weight:bold" %)**</init-param>**(%%) 104 + (% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Authentication Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 105 + (% style="color:#008000; font-weight:bold" %)**<filter-class>**(%%)org.jasig.cas.client.authentication.AuthenticationFilter(% style="color:#008000; font-weight:bold" %)**</filter-class>**(%%) 106 + (% style="color:#008000; font-weight:bold" %)**<init-param>**(%%) 107 + (% style="color:#008000; font-weight:bold" %)**<param-name>**(%%)casServerUrlPrefix(% style="color:#008000; font-weight:bold" %)**</param-name>**(%%) 108 + (% style="color:#008000; font-weight:bold" %)**<param-value>**(%%)https:~/~/www.sso.vsb.cz(% style="color:#008000; font-weight:bold" %)**</param-value>**(%%) 109 + (% style="color:#008000; font-weight:bold" %)**</init-param>**(%%) 110 + (% style="color:#008000; font-weight:bold" %)**<init-param>**(%%) 111 + (% style="color:#008000; font-weight:bold" %)**<param-name>**(%%)serverName(% style="color:#008000; font-weight:bold" %)**</param-name>**(%%) 112 + (% style="color:#008000; font-weight:bold" %)**<param-value>**(%%)https:~/~/klient.vsb.cz(% style="color:#008000; font-weight:bold" %)**</param-value>**(%%) 113 + (% style="color:#008000; font-weight:bold" %)**</init-param>**(%%) 114 114 (% style="color:#008000; font-weight:bold" %)**</filter>**(%%) 115 - 115 + 116 116 (% style="color:#008000; font-weight:bold" %)**<filter>**(%%) 117 -(% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Validation Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 118 -(% style="color:#008000; font-weight:bold" %)**<filter-class>**(%%)org.jasig.cas.client.validation.Cas30ProxyReceivingTicketValidationFilter(% style="color:#008000; font-weight:bold" %)**</filter-class>**(%%) 119 -(% style="color:#008000; font-weight:bold" %)**<init-param>**(%%) 120 - (% style="color:#008000; font-weight:bold" %)**<param-name>**(%%)casServerUrlPrefix(% style="color:#008000; font-weight:bold" %)**</param-name>**(%%) 121 - (% style="color:#008000; font-weight:bold" %)**<param-value>**(%%)https:~/~/www.sso.vsb.cz(% style="color:#008000; font-weight:bold" %)**</param-value>**(%%) 122 -(% style="color:#008000; font-weight:bold" %)**</init-param>**(%%) 123 -(% style="color:#008000; font-weight:bold" %)**<init-param>**(%%) 124 - (% style="color:#008000; font-weight:bold" %)**<param-name>**(%%)serverName(% style="color:#008000; font-weight:bold" %)**</param-name>**(%%) 125 - (% style="color:#008000; font-weight:bold" %)**<param-value>**(%%)https:~/~/klient.vsb.cz(% style="color:#008000; font-weight:bold" %)**</param-value>**(%%) 126 -(% style="color:#008000; font-weight:bold" %)**</init-param>**(%%) 117 + (% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Validation Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 118 + (% style="color:#008000; font-weight:bold" %)**<filter-class>**(%%)org.jasig.cas.client.validation.Cas30ProxyReceivingTicketValidationFilter(% style="color:#008000; font-weight:bold" %)**</filter-class>**(%%) 119 + (% style="color:#008000; font-weight:bold" %)**<init-param>**(%%) 120 + (% style="color:#008000; font-weight:bold" %)**<param-name>**(%%)casServerUrlPrefix(% style="color:#008000; font-weight:bold" %)**</param-name>**(%%) 121 + (% style="color:#008000; font-weight:bold" %)**<param-value>**(%%)https:~/~/www.sso.vsb.cz(% style="color:#008000; font-weight:bold" %)**</param-value>**(%%) 122 + (% style="color:#008000; font-weight:bold" %)**</init-param>**(%%) 123 + (% style="color:#008000; font-weight:bold" %)**<init-param>**(%%) 124 + (% style="color:#008000; font-weight:bold" %)**<param-name>**(%%)serverName(% style="color:#008000; font-weight:bold" %)**</param-name>**(%%) 125 + (% style="color:#008000; font-weight:bold" %)**<param-value>**(%%)https:~/~/klient.vsb.cz(% style="color:#008000; font-weight:bold" %)**</param-value>**(%%) 126 + (% style="color:#008000; font-weight:bold" %)**</init-param>**(%%) 127 127 (% style="color:#008000; font-weight:bold" %)**</filter>**(%%) 128 128 \\(% style="color:#008000; font-weight:bold" %)**<filter>**(%%) 129 -(% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS HttpServletRequest Wrapper Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 130 -(% style="color:#008000; font-weight:bold" %)**<filter-class>**(%%)org.jasig.cas.client.util.HttpServletRequestWrapperFilter(% style="color:#008000; font-weight:bold" %)**</filter-class>**(%%) 129 + (% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS HttpServletRequest Wrapper Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 130 + (% style="color:#008000; font-weight:bold" %)**<filter-class>**(%%)org.jasig.cas.client.util.HttpServletRequestWrapperFilter(% style="color:#008000; font-weight:bold" %)**</filter-class>**(%%) 131 131 (% style="color:#008000; font-weight:bold" %)**</filter>**(%%) 132 132 \\(% style="color:#008000; font-weight:bold" %)**<filter>**(%%) 133 -(% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Assertion Thread Local Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 134 -(% style="color:#008000; font-weight:bold" %)**<filter-class>**(%%)org.jasig.cas.client.util.AssertionThreadLocalFilter(% style="color:#008000; font-weight:bold" %)**</filter-class>**(%%) 133 + (% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Assertion Thread Local Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 134 + (% style="color:#008000; font-weight:bold" %)**<filter-class>**(%%)org.jasig.cas.client.util.AssertionThreadLocalFilter(% style="color:#008000; font-weight:bold" %)**</filter-class>**(%%) 135 135 (% style="color:#008000; font-weight:bold" %)**</filter>**(%%) 136 136 \\(% style="color:#008000; font-weight:bold" %)**<filter-mapping>**(%%) 137 -(% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Single Sign Out Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 138 -(% style="color:#008000; font-weight:bold" %)**<url-pattern>**(%%)/*(% style="color:#008000; font-weight:bold" %)**</url-pattern>**(%%) 137 + (% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Single Sign Out Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 138 + (% style="color:#008000; font-weight:bold" %)**<url-pattern>**(%%)/*(% style="color:#008000; font-weight:bold" %)**</url-pattern>**(%%) 139 139 (% style="color:#008000; font-weight:bold" %)**</filter-mapping>**(%%) 140 140 \\(% style="color:#008000; font-weight:bold" %)**<filter-mapping>**(%%) 141 -(% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Authentication Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 142 -(% style="color:#008000; font-weight:bold" %)**<url-pattern>**(%%)/*(% style="color:#008000; font-weight:bold" %)**</url-pattern>**(%%) 141 + (% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Authentication Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 142 + (% style="color:#008000; font-weight:bold" %)**<url-pattern>**(%%)/*(% style="color:#008000; font-weight:bold" %)**</url-pattern>**(%%) 143 143 (% style="color:#008000; font-weight:bold" %)**</filter-mapping>**(%%) 144 - 144 + 145 145 (% style="color:#008000; font-weight:bold" %)**<filter-mapping>**(%%) 146 -(% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Validation Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 147 -(% style="color:#008000; font-weight:bold" %)**<url-pattern>**(%%)/*(% style="color:#008000; font-weight:bold" %)**</url-pattern>**(%%) 146 + (% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Validation Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 147 + (% style="color:#008000; font-weight:bold" %)**<url-pattern>**(%%)/*(% style="color:#008000; font-weight:bold" %)**</url-pattern>**(%%) 148 148 (% style="color:#008000; font-weight:bold" %)**</filter-mapping>**(%%) 149 - 149 + 150 150 (% style="color:#008000; font-weight:bold" %)**<filter-mapping>**(%%) 151 -(% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS HttpServletRequest Wrapper Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 152 -(% style="color:#008000; font-weight:bold" %)**<url-pattern>**(%%)/*(% style="color:#008000; font-weight:bold" %)**</url-pattern>**(%%) 151 + (% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS HttpServletRequest Wrapper Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 152 + (% style="color:#008000; font-weight:bold" %)**<url-pattern>**(%%)/*(% style="color:#008000; font-weight:bold" %)**</url-pattern>**(%%) 153 153 (% style="color:#008000; font-weight:bold" %)**</filter-mapping>**(%%) 154 154 \\(% style="color:#008000; font-weight:bold" %)**<filter-mapping>**(%%) 155 -(% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Assertion Thread Local Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 156 -(% style="color:#008000; font-weight:bold" %)**<url-pattern>**(%%)/*(% style="color:#008000; font-weight:bold" %)**</url-pattern>**(%%) 155 + (% style="color:#008000; font-weight:bold" %)**<filter-name>**(%%)CAS Assertion Thread Local Filter(% style="color:#008000; font-weight:bold" %)**</filter-name>**(%%) 156 + (% style="color:#008000; font-weight:bold" %)**<url-pattern>**(%%)/*(% style="color:#008000; font-weight:bold" %)**</url-pattern>**(%%) 157 157 (% style="color:#008000; font-weight:bold" %)**</filter-mapping>**(%%) 158 158 \\(% style="color:#008000; font-weight:bold" %)**<listener>**(%%) 159 -(% style="color:#008000; font-weight:bold" %)**<listener-class>**(%%)org.jasig.cas.client.session.SingleSignOutHttpSessionListener(% style="color:#008000; font-weight:bold" %)**</listener-class>**(%%) 159 + (% style="color:#008000; font-weight:bold" %)**<listener-class>**(%%)org.jasig.cas.client.session.SingleSignOutHttpSessionListener(% style="color:#008000; font-weight:bold" %)**</listener-class>**(%%) 160 160 (% style="color:#008000; font-weight:bold" %)**</listener>**(%%)## 161 161 ))) 162 162 ))) ... ... @@ -171,6 +171,7 @@ 171 171 ))) 172 172 1. Přihlášenou osobu v aplikaci lze pak jednoduše zjistit pomoci((( 173 173 {{code language="java"}} 174 -request.getRemoteUser(); 174 +request.getRemoteUser(); 175 175 {{/code}} 176 176 ))) 177 +