{"id":193662,"date":"2013-09-13T16:37:03","date_gmt":"2013-09-13T12:37:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=193662"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=193662","title":{"rendered":"<span class=\"post_title\">\u0414\u0435\u043b\u0438\u043c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u043f\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 SSO \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 SAML 2.0<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h5>1. \u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h5>\n<p>  \u041d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 (Single Sign On, SSO) \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0435\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0426\u0435\u043b\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 Service Provider <sup>1<\/sup> (SP) \u0434\u043b\u044f SAML 2.0 identity provider (idP) \u0438 \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 SSO \u0432 Java Web \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. <\/p>\n<p>  \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0431\u044b\u043b\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0440\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0440\u0443\u043f\u043d\u043e\u0433\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (\u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438) \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0435\u0434\u0438\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c:<\/p>\n<ol>\n<li>Liferay version 6.1.20-ee-ga2.<\/li>\n<li>\u041f\u0440\u043e\u0441\u0442\u043e\u0435 java web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/li>\n<li>Google apps.<\/li>\n<\/ol>\n<p>  <u>\u0421\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u0431\u044b\u043b\u0438 \u0432\u044b\u0434\u0432\u0438\u043d\u0443\u0442\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f SSO:<\/u>  <\/p>\n<ol>\n<li>\u0414\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f SSO \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b SAML 2.0.<\/li>\n<li>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Jasig CAS \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c.<\/li>\n<li>LDAP \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/li>\n<\/ol>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 idP \u0440\u0435\u0448\u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Shibboleth (<a href=\"http:\/\/shibboleth.net\/about\/index.html\">http:\/\/shibboleth.net\/about\/index.html<\/a>) \u043a\u0430\u043a open source-\u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0443\u044e \u0432 \u043f\u043e\u043b\u043d\u043e\u043c \u043e\u0431\u044a\u0435\u043c\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b SAML 1.0 &#038;&#038; SAML 2.0. <\/p>\n<p>  <u>\u0421\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043f\u0440\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438:<\/u><\/p>\n<ol>\n<li>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u0438\u0437\u044b \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c SAML 2.0 \u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u043c Shibboleth.<\/li>\n<li>\u0421\u044b\u0440\u0430\u044f \u0438 \u0435\u0449\u0435 \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e Shibboleth \u043e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044f. <\/li>\n<li>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043f\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Service Provider\u2019\u0430 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 SSO \u0432 \u0441\u0432\u043e\u0435 Java Web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/li>\n<\/ol>\n<p>  \u041f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0431\u0430\u0440\u044c\u0435\u0440\u043e\u0432 \u0438 \u0441\u0442\u0430\u043b\u043e \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438, \u043f\u043e\u043c\u043e\u0447\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c SAML 2.0.<\/p>\n<h5>2. \u0414\u043b\u044f \u043a\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044f?<\/h5>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u044e:  <\/p>\n<ol>\n<li>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e SSO \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 SAML 2.0.<\/li>\n<li>Java-\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0443\u0436\u0435\u043d \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u0441\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 SSO \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 SAML 2.0.<\/li>\n<li>Java-\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0442\u044f\u0442 \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 SSO Identity Provider\u2019\u0430 (idP) \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Shibboleth.<\/li>\n<\/ol>\n<p>  \u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 SAML 2.0. <\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h5>3. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b SSO<\/h5>\n<p>  \u041d\u0430 \u0441\u0445\u0435\u043c\u0435 \u043d\u0438\u0436\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0430 \u043e\u0431\u0449\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/119\/21a\/068\/11921a06890ecf800d67d1b6d6c2e024.png\"\/><\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u043c\u043e\u043c\u0435\u043d\u0442\u044b, \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435:  <\/p>\n<ol>\n<li>\u0412 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 SSO \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0435\u0442 2 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<br \/>   a. Java Web App \u2014 \u043e\u0431\u044b\u0447\u043d\u043e\u0435 Java Web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<br \/>   b. Google Apps \u2014 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0445 \u0441\u043b\u0443\u0436\u0431 Google. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b SSO.<\/li>\n<li>SP Filter \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Service Provider, \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 Shibboleth idP \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0438 \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 SAML 2.0<\/li>\n<li>Shibboleth idP \u2014 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 SAML 1.0 \u0438 SAML 2.0.<\/li>\n<li>Tomcat AS \u2014 Java Application Server.<\/li>\n<li>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 SP filter \u0438 Shibboleth idP \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u043f\u043e \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 HTTPS.<\/li>\n<\/ol>\n<p>  \u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u041d\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435 Shibboleth idP \u0438 Java Web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0437\u043d\u0435\u0441\u0435\u043d\u044b \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u044b Tomcat. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0441\u0435\u0442\u0435\u0432\u043e\u043c \u0443\u0437\u043b\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u0438\u043d\u0441\u0442\u0430\u043d\u0441 Tomcat. <\/p>\n<h5>4. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f Shibboleth idP<\/h5>\n<p>  <\/p>\n<h6>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f shibboleth idP: <\/h6>\n<p>  1. \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e idP \u0442\u0443\u0442 <a href=\"http:\/\/shibboleth.net\/downloads\/identity-provider\/latest\/\">shibboleth.net\/downloads\/identity-provider\/latest\/<\/a><sup>2<\/sup> \u0438 \u0440\u0430\u0437\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e <i>$shDistr<\/i>.<br \/>  2. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f JAVA_HOME \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e<sup>3<\/sup>. <br \/>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <i>$shDistr\/install.sh<\/i> (\u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f UNIX-\u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c).<sup>4<\/sup> <\/p>\n<p>  \u0418\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0442\u043e\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0443\u043c\u0435:   <\/p>\n<ul>\n<li>\u043f\u0443\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: \/opt\/shib)<\/li>\n<li>\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 idP \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: idp.local.ru).\n<p>  <b>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 idP \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u043b\u0438\u0430\u0441\u043e\u0432 \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u0445\u043e\u0441\u0442\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/hosts:<\/b><br \/>   127.0.0.1 localhost idp.local.ru<\/li>\n<li>\u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f java key store, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: 12345).<\/li>\n<\/ul>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d. <\/p>\n<p>  \u0412\u0432\u0435\u0434\u0435\u043c \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li><i>$shHome<\/i> \u2014 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f, \u043a\u0443\u0434\u0430 \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d Shibboleth; <\/li>\n<li><i>$shHost<\/i> \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 idP \u0441\u0435\u0440\u0432\u0435\u0440\u0430; <\/li>\n<li><i>$shPassword<\/i> \u2014 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f java key store (JKS). <\/li>\n<\/ul>\n<p>  3. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0438 \u0438\u0437 \u043a\u0430\u043a\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c\u0441\u044f idP. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c login \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0432 \u0444\u0430\u0439\u043b <i>$shHome\/conf\/attribute-resolver.xml<\/i> \u043f\u043e\u0441\u043b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 &lt;resolver:AttributeDefinition id=\u00abtransientId\u00bb xsi:type=\u00abad:TransientId\u00bb&gt;. <\/p>\n<pre><code class=\"xml\">&lt;resolver:AttributeDefinition xsi:type=&quot;PrincipalName&quot;                   xmlns=&quot;urn:mace:shibboleth:2.0:resolver:ad&quot;  id=&quot;userLogin&quot; &gt;       &lt;resolver:AttributeEncoder xsi:type=&quot;SAML1String&quot;               xmlns=&quot;urn:mace:shibboleth:2.0:attribute:encoder&quot; name=&quot;userLogin&quot; \/&gt;       &lt;resolver:AttributeEncoder xsi:type=&quot;SAML2String&quot;               xmlns=&quot;urn:mace:shibboleth:2.0:attribute:encoder&quot; name=&quot;userLogin&quot; \/&gt; &lt;\/resolver:AttributeDefinition&gt; <\/code><\/pre>\n<p>  <i>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0438\u0437 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u0430\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 LDAP \u0438\u043b\u0438 DBMS \u0447\u0435\u0440\u0435\u0437 JDBC. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0442\u0443\u0442 <a href=\"https:\/\/wiki.shibboleth.net\/confluence\/display\/SHIB2\/IdPAddAttribute\">https:\/\/wiki.shibboleth.net\/confluence\/display\/SHIB2\/IdPAddAttribute<\/a>. <\/i><\/p>\n<p>  4. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b idP \u043e\u0442\u0434\u0430\u0432\u0430\u043b \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 SAML SP \u0444\u0438\u043b\u044c\u0442\u0440\u0443 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 <i>$shHome\/conf\/attribute-filter.xml<\/i>. <\/p>\n<pre><code class=\"xml\">&lt;afp:AttributeFilterPolicy id=&quot;releaseUserLoginToAnyone&quot;&gt;     &lt;afp:PolicyRequirementRule xsi:type=&quot;basic:ANY&quot;\/&gt;     &lt;afp:AttributeRule attributeID=&quot;userLogin&quot;&gt;         &lt;afp:PermitValueRule xsi:type=&quot;basic:ANY&quot;\/&gt;     &lt;\/afp:AttributeRule&gt; &lt;\/afp:AttributeFilterPolicy&gt; <\/code><\/pre>\n<p>  <i>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0435 \u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 SAML SP.<\/i><\/p>\n<p>  5. \u041d\u0430\u0448 Shibboleth idP \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u043d\u0430\u0442\u044c \u043e \u0442\u0435\u0445 \u0443\u0437\u043b\u0430\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u2013 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 relying party (<a href=\"https:\/\/wiki.shibboleth.net\/confluence\/display\/SHIB2\/IdPUnderstandingRP\">https:\/\/wiki.shibboleth.net\/confluence\/display\/SHIB2\/IdPUnderstandingRP<\/a>). \u042d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <i>$shHome\/conf\/relying-party.xml<\/i>. <br \/>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442:<\/p>\n<pre><code class=\"xml\">&lt;rp:RelyingParty id=&quot;sp.local.ru&quot; provider=&quot;https:\/\/idp.local.ru\/idp\/shibboleth&quot;                                          defaultSigningCredentialRef=&quot;IdPCredential&quot;&gt;    &lt;rp:ProfileConfiguration xsi:type=&quot;saml:SAML2SSOProfile&quot;        signResponses=&quot;never&quot; signAssertions=&quot;never&quot;        encryptNameIds=&quot;never&quot; encryptAssertions=&quot;never&quot; \/&gt; &lt;\/rp:RelyingParty&gt; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0434\u043b\u044f SP \u0441 id = \u00absp.local.ru\u00bb \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f idP \u0441 id=&quot;<a href=\"https:\/\/idp.local.ru\/idp\/shibboleth\">https:\/\/idp.local.ru\/idp\/shibboleth<\/a>&quot;.<\/p>\n<p>  <b>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 SP \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0430\u043b\u0438\u0430\u0441\u043e\u0432 \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u0445\u043e\u0441\u0442\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/hosts:<\/b><br \/>   127.0.0.1 localhost sp.local.ru<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0434\u0430\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 shibboleth idP \u043d\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c SAML 2.0 \u043e\u0442\u0432\u0435\u0442\u044b \u0438 \u043d\u0430\u0431\u043e\u0440 assertions (\u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439). \u0414\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u0448 shibboleth idP \u043d\u0435 \u0438\u043c\u0435\u043b \u043f\u043e\u043d\u044f\u0442\u0438\u044f, \u0447\u0442\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 id=\u00absp.local.ru\u00bb. \u0412\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442. \u0418\u0434\u0435\u043c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433.<\/p>\n<p>  6. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0433\u043e SAML 2.0 SP \u0444\u0438\u043b\u044c\u0442\u0440\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 <i>$shHome\/conf\/relying-party.xml<\/i> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u0430\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e SP, \u0440\u044f\u0434\u043e\u043c \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c &lt;metadata:MetadataProvider id=\u00abIdPMD\u00bb xsi:type=\u00abmetadata:FilesystemMetadataProvider\u00bb\u2026 &gt;<\/p>\n<pre><code class=\"xml\">&lt;metadata:MetadataProvider id=&quot;spMD&quot; xsi:type=&quot;metadata:FilesystemMetadataProvider&quot;                             metadataFile=&quot;\/opt\/shib\/metadata\/saml-sp-metadata.xml&quot;\/&gt; <\/code><\/pre>\n<p>  \u041c\u044b \u0434\u0430\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044e shibboleth idP \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 SP \u0432 \u0444\u0430\u0439\u043b\u0435 \/opt\/shib\/metadata\/saml-sp-metadata.xml. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c: <\/p>\n<pre><code class=\"xml\">&lt;md:EntityDescriptor xmlns:md=&quot;urn:oasis:names:tc:SAML:2.0:metadata&quot; entityID=&quot;sp.local.ru&quot;&gt;   &lt;md:SPSSODescriptor AuthnRequestsSigned=&quot;false&quot; ID=&quot;sp.local.ru&quot;       protocolSupportEnumeration=&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;&gt;     &lt;md:AssertionConsumerService Binding=&quot;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST&quot;        Location=&quot;https:\/\/sp.local.ru:8443\/sso\/acs&quot; index=&quot;1&quot; isDefault=&quot;true&quot;\/&gt;   &lt;\/md:SPSSODescriptor&gt; &lt;\/md:EntityDescriptor&gt; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\u043d\u0430\u0448 SAML 2.0 SP \u0438\u043c\u0435\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u00absp.local.ru\u00bb<\/li>\n<li>\u0430\u0434\u0440\u0435\u0441, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 shibboleth idP \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c SAML 2.0 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f <i>Location=&quot;<a href=\"https:\/\/sp.local.ru:8443\/sso\/acs\">https:\/\/sp.local.ru:8443\/sso\/acs<\/a>&quot;<\/i> \u0443\u043a\u0430\u0437\u0430\u043d \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 md:AssertionConsumerService. <\/li>\n<li>\u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 Binding=\u00aburn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST\u00bb \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u0442\u0432\u0435\u0442 SP \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0442 shibboleth idP \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u0431\u0440\u043e\u0443\u0437\u0435\u0440\u0430.<\/li>\n<\/ul>\n<p>  7. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c shibboleth idP \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0412 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 production \u0442\u0443\u0442 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 LDAP, DBMS \u0438 \u0434\u0430\u0436\u0435 CAS. \u0417\u0434\u0435\u0441\u044c, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f, \u043d\u0430 \u0432\u043a\u0443\u0441 \u0438 \u0446\u0432\u0435\u0442. \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 Remote User Authentication \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c (<a href=\"https:\/\/wiki.shibboleth.net\/confluence\/display\/SHIB2\/IdPAuthRemoteUser\">https:\/\/wiki.shibboleth.net\/confluence\/display\/SHIB2\/IdPAuthRemoteUser<\/a>). \u041f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e shibboleth idP \u0431\u0443\u0434\u0435\u0442 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e REMOTE_USER. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0435\u0441\u0442\u044c, \u0442\u043e shibboleth idP \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u043f\u0440\u043e\u0448\u0435\u043b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 Web Apache \u0441\u0435\u0440\u0432\u0435\u0440). \u0414\u0430\u0431\u044b \u043d\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u043e\u0439\u0442\u0438 \u043d\u0430 \u0445\u0438\u0442\u0440\u043e\u0441\u0442\u044c \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e REMOTE_USER \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. <br \/>  \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Tomcat AS (\u043f\u0443\u043d\u043a\u0442 7).<\/p>\n<p>  \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Shibboleth \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u0435\u043c \ud83d\ude42 <\/p>\n<h5>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f Tomcat \u0434\u043b\u044f shibboleth idP:<\/h5>\n<p>  <\/p>\n<ol>\n<li>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0442\u043e\u043c\u043a\u0430\u0442 6 <a href=\"http:\/\/tomcat.apache.org\/download-60.cgi\">http:\/\/tomcat.apache.org\/download-60.cgi<\/a>, \u0440\u0430\u0437\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 <i>$tomcatHome<\/i> (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: \u0432 opt\/shib-tomcat).\n<p>  <b>\u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 Tomcat 7.* \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 SP \u0438 idP \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 SOAP. \u0418 \u0445\u043e\u0442\u044f \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u044f\u043c\u044b\u0435 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u044b \u0431\u0440\u043e\u0443\u0437\u0435\u0440\u0430 \u0434\u043b\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0439, \u043c\u044b \u0432\u0441\u0435 \u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Tomcat \u0432\u0435\u0440\u0441\u0438\u0438 6.<\/b><\/li>\n<li>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u043f\u043a\u0443 <i>$shDistr\/endorsed<\/i> \u0432 \u043f\u0430\u043f\u043a\u0443 <i>$tomcatHome<\/i>.<\/li>\n<li>\u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0444\u0430\u0439\u043b <i>$tomcatHome\/bin\/setenv.s<\/i>h, \u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438 \u043f\u0435\u0440\u043c\u0430\u043d\u0435\u043d\u0442\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 JVM: <br \/>  JAVA_OPTS=&quot;$JAVA_OPTS -Xmx512m -XX:MaxPermSize=128m&quot;<\/li>\n<li>\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 (<a href=\"https:\/\/build.shibboleth.net\/nexus\/content\/repositories\/releases\/edu\/internet2\/middleware\/security\/tomcat6\/tomcat6-dta-ssl\/1.0.0\/tomcat6-dta-ssl-1.0.0.jar\">https:\/\/build.shibboleth.net\/nexus\/content\/repositories\/releases\/edu\/internet2\/middleware\/security\/tomcat6\/tomcat6-dta-ssl\/1.0.0\/tomcat6-dta-ssl-1.0.0.jar<\/a>) \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 SOAP \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 SP \u0438 idP \u0432 \u043f\u0430\u043f\u043a\u0443 <i>$tomcatHome\/lib<\/i>.<br \/>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c <i>$tomcatHome\/conf\/server.xml<\/i> \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0442\u043e\u043c\u043a\u0430\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 HTTPS. <br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 Connector:\n<pre><code class=\"xml\">&lt;Connector port=&quot;8443&quot;        protocol=&quot;org.apache.coyote.http11.Http11Protocol&quot;        SSLImplementation=&quot;edu.internet2.middleware.security.tomcat6.DelegateToApplicationJSSEmplementation&quot;        scheme=&quot;https&quot;        SSLEnabled=&quot;true&quot;        clientAuth=&quot;want&quot;            keystoreFile=&quot;$shHome\/credentials\/idp.jks&quot;            keystorePass=&quot;$shPassword&quot; \/&gt; <\/code><\/pre>\n<p>  <b>\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 $shHome \u0438 $shPassword \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438<\/b>.<\/li>\n<li>\u0414\u0435\u043f\u043b\u043e\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 shibboleth idP \u0432 Tomcat. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b <br \/>  <i>$tomcatHome\/conf\/Catalina\/localhost\/idp.xml<\/i> \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:\n<pre><code class=\"xml\">&lt;Context docBase=&quot;$shHome\/war\/idp.war&quot; privileged=&quot;true&quot;    antiResourceLocking=&quot;false&quot; antiJARLocking=&quot;false&quot; unpackWAR=&quot;false&quot;   swallowOutput=&quot;true&quot; \/&gt; <\/code><\/pre>\n<p>  \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 $shHome \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c<\/li>\n<li>\u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c<sup>5<\/sup> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 tomcat-valve.jar:\n<pre><code class=\"java\">  public class RemoteUserValve extends ValveBase{     public RemoteUserValve() {         }          @Override         public void invoke(final Request request, final Response response)          throws IOException, ServletException {            final String username = &quot;idpuser&quot;;         final String credentials = &quot;idppass&quot;;         final List&lt;String&gt; roles = new ArrayList&lt;String&gt;();         final Principal principal = new GenericPrincipal(null, username, credentials,                                                                roles);          request.setUserPrincipal(principal);         getNext().invoke(request, response);       }      } <\/code><\/pre>\n<p>  \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0443 ${tomcatHome}\/lib. \u0418 \u0432 \u0444\u0430\u0439\u043b server.xml \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u0447\u043a\u0443<br \/>  &lt;Valve \u0441lassName=\u00abru.eastbanctech.java.web.RemoteUserValve\u00bb \/&gt; \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <br \/>  &lt;Host name=\u00ablocalhost\u00bb appBase=\u00abwebapps\u00bb ..&gt;. \u041f\u043e\u0441\u043b\u0435 \u0441\u0442\u0430\u0440\u0442\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e Tomcat \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 REMOTE_USER \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c idpuser \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0430.   <\/li>\n<\/ol>\n<p>  <\/p>\n<h5>5. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f SP Filter \u0434\u043b\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 SAML 2.0<\/h5>\n<p>  \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c SAML 2.0 Service Provider \u0444\u0438\u043b\u044c\u0442\u0440, \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442:  <\/p>\n<ol>\n<li>\u0424\u0438\u043b\u044c\u0442\u0440 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f. <\/li>\n<li>\u0424\u0438\u043b\u044c\u0442\u0440 \u0445\u0440\u0430\u043d\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0439 \u043a Shibboleth idP.<\/li>\n<li>\u0424\u0438\u043b\u044c\u0442\u0440 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 SAML 2.0 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0432 \u0432\u0438\u0434\u0435 SAML 2.0 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f (<i>AuthN<\/i>) \u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a Shibboleth idP. <\/li>\n<li>\u0424\u0438\u043b\u044c\u0442\u0440 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 Shibboleth idP, \u0438 \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441. <\/li>\n<li>\u0424\u0438\u043b\u044c\u0442\u0440 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e \u043f\u0440\u0438 \u043b\u043e\u0433\u0430\u0443\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0437 Java Web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/li>\n<li>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0435\u0441\u0441\u0438\u044f \u043d\u0430 shibboleth idP \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439. <\/li>\n<\/ol>\n<p>  \u0421 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u0431\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 javax.filter.Filter. \u041e\u0431\u043b\u0430\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. <\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438: <br \/>  1. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043a\u0435\u043b\u0435\u0442 maven \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <br \/>  \u041c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043f\u043b\u0430\u0433\u0438\u043d mvn:archetype:<br \/>  mvn archetype:generate -DgroupId=ru.eastbanctech.java.web -DartifactId=saml-sp-filter -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false<br \/>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b groupId \u0438 artefactId \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0439 \u0432\u043a\u0443\u0441 \u0438 \u0446\u0432\u0435\u0442.<br \/>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 Intellij Idea \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/d32\/10b\/1e8\/d3210b1e849e5ef694f5b075aed72f28.png\"\/><\/p>\n<p>  2. \u0424\u0430\u0439\u043b \u0441\u0431\u043e\u0440\u043a\u0438 pom.xml: <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;source lang=&quot;xml&quot;&gt; &lt;project xmlns=&quot;http:\/\/maven.apache.org\/POM\/4.0.0&quot;    xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;              xsi:schemaLocation=&quot;http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd&quot;&gt;      &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;     &lt;groupId&gt;ru.eastbanctech.web&lt;\/groupId&gt;     &lt;artifactId&gt;saml-sp-filter&lt;\/artifactId&gt;     &lt;name&gt;${project.artifactId}&lt;\/name&gt;     &lt;version&gt;1.0-SNAPSHOT&lt;\/version&gt;     &lt;packaging&gt;jar&lt;\/packaging&gt;     &lt;properties&gt;                 &lt;jdk.version&gt;1.6&lt;\/jdk.version&gt;         &lt;encoding&gt;UTF-8&lt;\/encoding&gt;         &lt;project.build.sourceEncoding&gt;${encoding}&lt;\/project.build.sourceEncoding&gt;         &lt;project.reporting.outputEncoding&gt;${encoding}&lt;\/project.reporting.outputEncoding&gt;     &lt;\/properties&gt;     &lt;build&gt;       &lt;pluginManagement&gt;         &lt;plugins&gt;           &lt;plugin&gt;             &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;             &lt;artifactId&gt;maven-compiler-plugin&lt;\/artifactId&gt;             &lt;version&gt;2.5.1&lt;\/version&gt;             &lt;configuration&gt;               &lt;encoding&gt;${encoding}&lt;\/encoding&gt;               &lt;sour\u0441e&gt;${jdk.version}&lt;\/sour\u0441e&gt;               &lt;target&gt;${jdk.version}&lt;\/target&gt;             &lt;\/configuration&gt;           &lt;\/plugin&gt;         &lt;\/plugins&gt;       &lt;\/pluginManagement&gt;     &lt;\/build&gt;     &lt;dependency&gt;       &lt;groupId&gt;org.opensaml&lt;\/groupId&gt;       &lt;artifactId&gt;opensaml&lt;\/artifactId&gt;       &lt;version&gt;2.5.1-1&lt;\/version&gt;     &lt;\/dependency&gt;      &lt;dependency&gt;       &lt;groupId&gt;javax.servlet&lt;\/groupId&gt;       &lt;artifactId&gt;servlet-api&lt;\/artifactId&gt;       &lt;version&gt;2.5&lt;\/version&gt;       &lt;scope&gt;provided&lt;\/scope&gt;     &lt;\/dependency&gt;         &lt;dependency&gt;           &lt;groupId&gt;org.slf4j&lt;\/groupId&gt;           &lt;artifactId&gt;log4j-over-slf4j&lt;\/artifactId&gt;           &lt;version&gt;1.7.1&lt;\/version&gt;         &lt;\/dependency&gt;          &lt;dependency&gt;           &lt;groupId&gt;org.slf4j&lt;\/groupId&gt;           &lt;artifactId&gt;slf4j-api&lt;\/artifactId&gt;           &lt;version&gt;1.7.1&lt;\/version&gt;         &lt;\/dependency&gt;     &lt;\/dependencies&gt; &lt;\/project&gt;   <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  3. \u0421\u0435\u0440\u0434\u0446\u0435\u043c \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 SAMLSPFilter:<\/p>\n<pre><code class=\"java\">public class SAMLSPFilter implements Filter {    public static final String SAML_AUTHN_RESPONSE_PARAMETER_NAME = &quot;SAMLResponse&quot;;            private static Logger log = LoggerFactory.getLogger(SAMLSPFilter.class);    private FilterConfig filterConfig;    private SAMLResponseVerifier checkSAMLResponse;    private SAMLRequestSender samlRequestSender;      @Override    public void init(javax.servlet.FilterConfig config) throws ServletException {      OpenSamlBootstrap.init();      filterConfig = new FilterConfig(config);      checkSAMLResponse = new SAMLResponseVerifier();      samlRequestSender = new SAMLRequestSender();         }     @Override    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,                                        FilterChain chain) throws IOException, ServletException {      HttpServletRequest request = (HttpServletRequest) servletRequest;      HttpServletResponse response = (HttpServletResponse) servletResponse;   \/*   \u0428\u0410\u0413 1: \u0418\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u043d\u0435 \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430   \u0428\u0410\u0413 2: \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u0448\u0435\u043b \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 Shibboleth idP, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e   \u0428\u0410\u0413 3: \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 logout, \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e   \u0428\u0410\u0413 4: \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d, \u0434\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0443   \u0428\u0410\u0413 5: \u0421\u043e\u0437\u0434\u0430\u0435\u043c SAML \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a          Shibboleth idP   *\/  } } <\/code><\/pre>\n<p>  \u0412 \u043a\u043b\u0430\u0441\u0441 FilterConfig \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 (\u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 idP, \u043f\u0443\u0442\u044c \u0434\u043e \u043c\u0435\u0442\u0430\u0434\u0430\u0442\u044b idP, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 SP \u0438 \u0442.\u0434.). \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 web.xml Java Web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0431\u044a\u0435\u043a\u0442\u044b checkSAMLResponse \u0438 samlRequestSender \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 SAML 2.0 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041a \u043d\u0438\u043c \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public class FilterConfig {   \/**   * The parameters below should be defined in web.xml file of Java Web Application   *\/   public static final String EXCLUDED_URL_PATTERN_PARAMETER = &quot;excludedUrlPattern&quot;;   public static final String SP_ACS_URL_PARAMETER           = &quot;acsUrl&quot;;   public static final String SP_ID_PARAMETER                = &quot;spProviderId&quot;;        public static final String SP_LOGOUT_URL_PARAMETER        = &quot;logoutUrl&quot;;   public static final String IDP_SSO_URL_PARAMETER          = &quot;idProviderSSOUrl&quot;;    private String excludedUrlPattern;   private String acsUrl;   private String spProviderId;   private String logoutUrl;   private String idpSSOUrl;    public FilterConfig(javax.servlet.FilterConfig config) {     excludedUrlPattern = config.getInitParameter(EXCLUDED_URL_PATTERN_PARAMETER);     acsUrl = config.getInitParameter(SP_ACS_URL_PARAMETER);     spProviderId = config.getInitParameter(SP_ID_PARAMETER);     idpSSOUrl = config.getInitParameter(IDP_SSO_URL_PARAMETER);     logoutUrl = config.getInitParameter(SP_LOGOUT_URL_PARAMETER);   }    \/\/ getters and should be defined below  } \u041a\u043b\u0430\u0441\u0441 OpenSamlBootstrap \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SAML 2.0 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438:  public class OpenSamlBootstrap extends DefaultBootstrap {   private static Logger log = LoggerFactory.getLogger(OpenSamlBootstrap.class);   private static boolean initialized;   private static String[] xmlToolingConfigs = {     &quot;\/default-config.xml&quot;,     &quot;\/encryption-validation-config.xml&quot;,     &quot;\/saml2-assertion-config.xml&quot;,     &quot;\/saml2-assertion-delegation-restriction-config.xml&quot;,     &quot;\/saml2-core-validation-config.xml&quot;,     &quot;\/saml2-metadata-config.xml&quot;,     &quot;\/saml2-metadata-idp-discovery-config.xml&quot;,     &quot;\/saml2-metadata-query-config.xml&quot;,     &quot;\/saml2-metadata-validation-config.xml&quot;,     &quot;\/saml2-protocol-config.xml&quot;,     &quot;\/saml2-protocol-thirdparty-config.xml&quot;,     &quot;\/schema-config.xml&quot;,     &quot;\/signature-config.xml&quot;,     &quot;\/signature-validation-config.xml&quot;   };      public static synchronized void init() {     if (!initialized) {       try {         initializeXMLTooling(xmlToolingConfigs);       } catch (ConfigurationException e) {         log.error(&quot;Unable to initialize opensaml DefaultBootstrap&quot;, e);       }       initializeGlobalSecurityConfiguration();       initialized = true;     }   } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041d\u0430\u0431\u043e\u0440 XML \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u043a\u0430\u043a \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b SAML 2.0 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 opensaml-*.jar, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 maven.<\/p>\n<p>  <b>\u0428\u0410\u0413 1: \u0418\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043d\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430 <\/b><br \/>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <i>excludedUrlPattern<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d <i>excludedUrlPattern<\/i>, \u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440 \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0435\u0433\u043e: <\/p>\n<pre><code class=\"java\">if (!isFilteredRequest(request)) {   log.debug(&quot;According to {} configuration parameter request is ignored + {}&quot;,       new Object[]{FilterConfig.EXCLUDED_URL_PATTERN, request.getRequestURI()});   chain.doFilter(servletRequest, servletResponse);   return; }  \/\/ \u0412 \u043a\u043b\u0430\u0441\u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u043e\u0434, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0438\u0439 \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 private boolean isFilteredRequest(HttpServletRequest request) {   return !(filterConfig.getExcludedUrlPattern() != null &&              getCorrectURL(request).matches(filterConfig.getExcludedUrlPattern()));    }    \/\/ \u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e URL private String getCorrectURL(HttpServletRequest request) {   String contextPath = request.getContextPath();   String requestUri = request.getRequestURI();   int contextBeg = requestUri.indexOf(contextPath);   int contextEnd = contextBeg + contextPath.length();   String slash = &quot;\/&quot;;   String url = (contextBeg &lt; 0 || contextEnd == (requestUri.length() - 1))                     ? requestUri : requestUri.substring(contextEnd);   if (!url.startsWith(slash)) {       url = slash + url;   }   return url; } <\/code><\/pre>\n<p>  <b>\u0428\u0430\u0433 2: \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u0448\u0435\u043b \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 Shibboleth idP, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e<\/b><br \/>  \u0418\u0449\u0435\u043c \u0432 \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u201cSAMLResponse\u201d \u0438 \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0430\u0439\u0434\u0435\u043d, \u0437\u043d\u0430\u0447\u0438\u0442, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 shibboleth idP \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 SAML 2.0 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">log.debug(&quot;Attempt to secure resource  is intercepted : {}&quot;, ((HttpServletRequest) servletRequest).getRequestURL().toString()); \/*   Check if response message is received from identity provider;   In case of successful response system redirects user to relayState (initial) request *\/ String responseMessage = servletRequest.getParameter(SAML_AUTHN_RESPONSE_PARAMETER_NAME); if (responseMessage != null) {   log.debug(&quot;Response from Identity Provider is received&quot;);   try {     log.debug(&quot;Decoding of SAML message&quot;);     SAMLMessageContext samlMessageContext =                      SAMLUtils.decodeSamlMessage((HttpServletRequest) servletRequest,                                                  (HttpServletResponse) servletResponse);     log.debug(&quot;SAML message has been decoded successfully&quot;);     samlMessageContext.setLocalEntityId(filterConfig.getSpProviderId());     String relayState = getInitialRequestedResource(samlMessageContext);     checkSAMLResponse.verify(samlMessageContext);     log.debug(&quot;Starting and store SAML session..&quot;);     SAMLSessionManager.getInstance().createSAMLSession(request.getSession(),                                                                     samlMessageContext);     log.debug(&quot;User has been successfully authenticated in idP. Redirect to initial                                                     requested resource {}&quot;, relayState);             response.sendRedirect(relayState);     return;   } catch (Exception e) {        throw new ServletException(e);   } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u043c SAML \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <i>SAMLUtils.decodeSamlMessage(..)<\/i>, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c\u043e\u0441\u0442\u044c SAML \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439 \u2014 <i>checkSAMLResponse.verify(..)<\/i>. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e SAML \u0441\u0435\u0441\u0441\u0438\u044e <i>SAMLSessionManager.getInstance().createSAMLSession(..)<\/i> \u0438 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 <i>response.sendRedirect(..).<\/i><\/p>\n<p>  \u0412 \u043a\u043b\u0430\u0441\u0441\u0435 SAMLUtils \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 SAML 2.0 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 decodeSamlMessage, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 HTTPS SAML 2.0 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public class SAMLUtils {   public static SAMLMessageContext decodeSamlMessage(HttpServletRequest request,  \t\t\t\tHttpServletResponse response) throws Exception {      SAMLMessageContext&lt;SAMLObject, SAMLObject, NameID&gt; samlMessageContext =                  new BasicSAMLMessageContext&lt;SAMLObject, SAMLObject, NameID&gt;();      HttpServletRequestAdapter httpServletRequestAdapter =                                           new HttpServletRequestAdapter(request);     samlMessageContext.setInboundMessageTransport(httpServletRequestAdapter);     samlMessageContext.setInboundSAMLProtocol(SAMLConstants.SAML20P_NS);     HttpServletResponseAdapter httpServletResponseAdapter =                      new HttpServletResponseAdapter(response, request.isSecure());     samlMessageContext.setOutboundMessageTransport(httpServletResponseAdapter);     samlMessageContext.setPeerEntityRole(IDPSSODescriptor.DEFAULT_ELEMENT_NAME);          SecurityPolicyResolver securityPolicyResolver =                                      getSecurityPolicyResolver(request.isSecure());          samlMessageContext.setSecurityPolicyResolver(securityPolicyResolver);     HTTPPostDecoder samlMessageDecoder = new HTTPPostDecoder();     samlMessageDecoder.decode(samlMessageContext);     return samlMessageContext;   }    private static SecurityPolicyResolver getSecurityPolicyResolver(boolean isSecured) {     SecurityPolicy securityPolicy = new BasicSecurityPolicy();     HTTPRule httpRule = new HTTPRule(null, null, isSecured);     MandatoryIssuerRule mandatoryIssuerRule = new MandatoryIssuerRule();     List&lt;SecurityPolicyRule&gt; securityPolicyRules = securityPolicy.getPolicyRules();     securityPolicyRules.add(httpRule);     securityPolicyRules.add(mandatoryIssuerRule);     return new StaticSecurityPolicyResolver(securityPolicy);   } } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412 \u044d\u0442\u043e\u0442 \u0436\u0435 \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f SAML \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 String. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 SAML \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439.   <\/p>\n<pre><code class=\"java\">public static String SAMLObjectToString(XMLObject samlObject) {   try {     Marshaller marshaller =           org.opensaml.Configuration.getMarshallerFactory().getMarshaller(samlObject);     org.w3c.dom.Element authDOM = marshaller.marshall(samlObject);     StringWriter rspWrt = new StringWriter();     XMLHelper.writeNode(authDOM, rspWrt);     return rspWrt.toString();   } catch (Exception e) {     e.printStackTrace();      }   return null; } <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 SAMLResponseVerifier, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 SAML 2.0 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u043e\u0442 shibboleth idP. \u0412 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 verify(..) \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438: <\/p>\n<ul>\n<li>\u0414\u0430\u043d\u043d\u043e\u043c\u0443 SAML 2.0 \u043e\u0442\u0432\u0435\u0442\u0443 \u043e\u0442 idP \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b SAML 2.0 \u0437\u0430\u043f\u0440\u043e\u0441, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0448\u0438\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c.<\/li>\n<li>\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0447\u0435\u0440\u0435\u0437 shibboleth idP.<\/li>\n<li>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 SAML 2.0 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b (\u0441\u0440\u043e\u043a \u0434\u0430\u0432\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u0441\u0442\u0435\u043a, \u0434\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e SP \u0438 \u0442.\u0434.).<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\"> public class SAMLResponseVerifier {   private static Logger log = LoggerFactory.getLogger(SAMLResponseVerifier.class);   private SAMLRequestStore samlRequestStore = SAMLRequestStore.getInstance();    public void verify(SAMLMessageContext&lt;Response, SAMLObject, NameID&gt; samlMessageContext)      throws SAMLException {     Response samlResponse = samlMessageContext.getInboundSAMLMessage();     log.debug(&quot;SAML Response message : {}&quot;, SAMLUtils.SAMLObjectToString(samlResponse));     verifyInResponseTo(samlResponse);     Status status = samlResponse.getStatus();     StatusCode statusCode = status.getStatusCode();     String statusCodeURI = statusCode.getValue();     if (!statusCodeURI.equals(StatusCode.SUCCESS_URI)) {       log.warn(&quot;Incorrect SAML message code : {} &quot;,                     statusCode.getStatusCode().getValue());       throw new SAMLException(&quot;Incorrect SAML message code : &quot; + statusCode.getValue());     }     if (samlResponse.getAssertions().size() == 0) {       log.error(&quot;Response does not contain any acceptable assertions&quot;);       throw new SAMLException(&quot;Response does not contain any acceptable assertions&quot;);     }      Assertion assertion = samlResponse.getAssertions().get(0);     NameID nameId = assertion.getSubject().getNameID();     if (nameId == null) {       log.error(&quot;Name ID not present in subject&quot;);       throw new SAMLException(&quot;Name ID not present in subject&quot;);     }     log.debug(&quot;SAML authenticated user &quot; + nameId.getValue());     verifyConditions(assertion.getConditions(), samlMessageContext);   }  private void verifyInResponseTo(Response samlResponse) {     String key = samlResponse.getInResponseTo();   if (!samlRequestStore.exists(key)) { {     log.error(&quot;Response does not match an authentication request&quot;);     throw new RuntimeException(&quot;Response does not match an authentication request&quot;);   }   samlRequestStore.removeRequest(samlResponse.getInResponseTo()); }  private void verifyConditions(Conditions conditions, SAMLMessageContext samlMessageContext) throws SAMLException{     verifyExpirationConditions(conditions);     verifyAudienceRestrictions(conditions.getAudienceRestrictions(), samlMessageContext); } private void verifyExpirationConditions(Conditions conditions) throws SAMLException {   log.debug(&quot;Verifying conditions&quot;);   DateTime currentTime = new DateTime(DateTimeZone.UTC);   log.debug(&quot;Current time in UTC : &quot; + currentTime);   DateTime notBefore = conditions.getNotBefore();   log.debug(&quot;Not before condition : &quot; + notBefore);   if ((notBefore != null) && currentTime.isBefore(notBefore))     throw new SAMLException(&quot;Assertion is not conformed with notBefore condition&quot;);    DateTime notOnOrAfter = conditions.getNotOnOrAfter();   log.debug(&quot;Not on or after condition : &quot; + notOnOrAfter);   if ((notOnOrAfter != null) && currentTime.isAfter(notOnOrAfter))     throw new SAMLException(&quot;Assertion is not conformed with notOnOrAfter condition&quot;); }   private void verifyAudienceRestrictions(  List&lt;AudienceRestriction&gt; audienceRestrictions,             SAMLMessageContext&lt;?, ?, ?&gt; samlMessageContext)             throws SAMLException{ \/\/ TODO: Audience restrictions should be defined below&lt;sup&gt;7&lt;\/sup&gt;  } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 <i>verifyInResponseTo<\/i> \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e SAML 2.0-\u043e\u0442\u0432\u0435\u0442\u0443 \u043f\u0440\u0435\u0434\u0448\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430. \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 SAMLRequestStore, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 SAML 2.0 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a shibboleth idP.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">final public class SAMLRequestStore {   private Set&lt;String&gt; samlRequestStorage = new HashSet&lt;String&gt;();     private IdentifierGenerator identifierGenerator = new RandomIdentifierGenerator();   private static SAMLRequestStore instance = new SAMLRequestStore();    private SAMLRequestStore() {   }    public static SAMLRequestStore getInstance() {     return instance;   }    public synchronized void storeRequest(String key) {     if (samlRequestStorage.contains(key))      throw new RuntimeException(&quot;SAML request storage has already contains key &quot; + key);          samlRequestStorage.add(key);   }   public synchronized String storeRequest(){      String key = null;      while (true) {        key = identifierGenerator.generateIdentifier(20);        if (!samlRequestStorage.contains(key)){          storeRequest(key);          break;        }      }     return key;   }   public synchronized boolean exists(String key) {     return samlRequestStorage.contains(key);   }    public synchronized void removeRequest(String key) {     samlRequestStorage.remove(key);   } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 SAMLSessionManager. \u0415\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c\/\u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0441\u0441\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 SAMLSessionInfo. <\/p>\n<pre><code class=\"java\">public class SAMLSessionInfo {   private String nameId;   private Map&lt;String, String&gt; attributes;   private Date validTo;   public SAMLSessionInfo(String nameId, Map&lt;String, String&gt; attributes, Date validTo) {     this.nameId = nameId;     this.attributes = attributes;     this.validTo = validTo;   }    \/\/ getters should be defined below  } <\/code><\/pre>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0430\u043c \u043a\u043b\u0430\u0441\u0441 SAMLSessionManager, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0438 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 SAML \u0441\u0435\u0441\u0441\u0438\u0438 \u0432 Session \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 c\u0435\u0440\u0432\u043b\u0435\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f SAMLContext.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;source lang=&quot;java&quot;&gt; public class SAMLSessionManager {   public static String SAML_SESSION_INFO = &quot;SAML_SESSION_INFO&quot;;   private static SAMLSessionManager instance = new SAMLSessionManager();    private SAMLSessionManager() {   }     public static SAMLSessionManager getInstance() {     return instance;   }    public void createSAMLSession(HttpSession session, SAMLMessageContext&lt;Response,           SAMLObject, NameID&gt; samlMessageContext) {     List&lt;Assertion&gt; assertions =                        samlMessageContext.getInboundSAMLMessage().getAssertions();     NameID nameId = (assertions.size() != 0 && assertions.get(0).getSubject() != null) ?                       assertions.get(0).getSubject().getNameID() : null;     String nameValue = nameId == null ? null : nameId.getValue();     SAMLSessionInfo samlSessionInfo = new SAMLSessionInfo(nameValue,                                       getAttributesMap(getSAMLAttributes(assertions)),                                       getSAMLSessionValidTo(assertions));     session.setAttribute(SAML_SESSION_INFO, samlSessionInfo);   }        public boolean isSAMLSessionValid(HttpSession session) {         SAMLSessionInfo samlSessionInfo = (SAMLSessionInfo)                               session.getAttribute(SAML_SESSION_INFO);         if (samlSessionInfo == null)             return false;         return samlSessionInfo.getValidTo() == null || new                   Date().before(samlSessionInfo.getValidTo());   }    public void destroySAMLSession(HttpSession session) {               session.removeAttribute(SAML_SESSION_INFO);   }    public List&lt;Attribute&gt; getSAMLAttributes(List&lt;Assertion&gt; assertions) {     List&lt;Attribute&gt; attributes = new ArrayList&lt;Attribute&gt;();     if (assertions != null) {       for (Assertion assertion : assertions) {         for (AttributeStatement attributeStatement :                                   assertion.getAttributeStatements()) {           for (Attribute attribute : attributeStatement.getAttributes()) {              attributes.add(attribute);           }         }      }    }    return attributes;  }   public Date getSAMLSessionValidTo(List&lt;Assertion&gt; assertions) {    org.joda.time.DateTime sessionNotOnOrAfter = null;    if (assertions != null) {      for (Assertion assertion : assertions) {        for (AuthnStatement statement : assertion.getAuthnStatements()) {          sessionNotOnOrAfter = statement.getSessionNotOnOrAfter();        }      }    }     return sessionNotOnOrAfter != null ?             sessionNotOnOrAfter.toCalendar(Locale.getDefault()).getTime() : null;  }  public Map&lt;String, String&gt; getAttributesMap(List&lt;Attribute&gt; attributes) {    Map&lt;String, String&gt; result = new HashMap&lt;String, String&gt;();    for (Attribute attribute : attributes) {      result.put(attribute.getName(), attribute.getDOM().getTextContent());    }    return result;  }       } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <b>\u0428\u0430\u0433 3: \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 logout, \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e<\/b><\/p>\n<pre><code class=\"java\">if (getCorrectURL(request).equals(filterConfig.getLogoutUrl())) {   log.debug(&quot;Logout action: destroying SAML session.&quot;);   SAMLSessionManager.getInstance().destroySAMLSession(request.getSession());   chain.doFilter(request, response);   return; } <\/code><\/pre>\n<p>  <i>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0435\u0441\u0441\u0438\u044f \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043d\u0430 shibboleth idP \u0438 \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e shibboleth idP \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0440\u043d\u0435\u0442 \u043d\u0430\u043c \u0430\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0436\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e logout \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0438 \u0434\u043e \u0432\u0435\u0440\u0441\u0438\u0438 2.4.0 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b\u0430\u0441\u044c shibboleth idP. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0443\u0442 <a href=\"https:\/\/wiki.shibboleth.net\/confluence\/display\/SHIB2\/SLOIssues\">https:\/\/wiki.shibboleth.net\/confluence\/display\/SHIB2\/SLOIssues<\/a> <\/i><\/p>\n<p>  <b>\u0428\u0430\u0433 4: \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d, \u0434\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0443<\/b><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438\u043c\u0435\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u0443\u044e SAML \u0441\u0435\u0441\u0441\u0438\u044e \u0432 \u043d\u0430\u0448\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u0435, \u0442\u043e \u0434\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441.  <\/p>\n<pre><code class=\"xml\">if (SAMLSessionManager.getInstance().isSAMLSessionValid(request.getSession())) {      log.debug(&quot;SAML session exists and valid: grant access to secure resource&quot;);      chain.doFilter(request, response);      return; } <\/code><\/pre>\n<p>  <b>\u0428\u0430\u0433 5: \u0421\u043e\u0437\u0434\u0430\u0435\u043c SAML \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a<br \/>  Shibboleth idP<\/b><\/p>\n<pre><code class=\"java\">log.debug(&quot;Sending authentication request to idP&quot;); try {   samlRequestSender .sendSAMLAuthRequest(request, response,      filterConfig.getSpProviderId(), filterConfig.getAcsUrl(),      filterConfig.getIdpSSOUrl()); } catch (Exception e) {    throw new ServletException(e);  }  <\/code><\/pre>\n<p>  \u041a\u043b\u0430\u0441\u0441 SAMLRequestSender \u0441\u043e\u0437\u0434\u0430\u0435\u0442, \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0432\u0438\u0434\u0435 SAML 2.0-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;source lang=&quot;java&quot;&gt; public class SAMLRequestSender {   private static Logger log = LoggerFactory.getLogger(SAMLRequestSender.class);   private SAMLAuthnRequestBuilder samlAuthnRequestBuilder =                                                     new SAMLAuthnRequestBuilder();   private MessageEncoder messageEncoder = new MessageEncoder();    public void sendSAMLAuthRequest(HttpServletRequest request, HttpServletResponse       servletResponse, String spId, String acsUrl, String idpSSOUrl) throws Exception {     String redirectURL;     String idpUrl = idpSSOUrl;     AuthnRequest authnRequest = samlAuthnRequestBuilder.buildRequest(spId, acsUrl,                                     idpUrl);     \/\/ store SAML 2.0 authentication request     String key = SAMLRequestStore.getInstance().storeRequest();     authnRequest.setID(key);     log.debug(&quot;SAML Authentication message : {} &quot;,                              SAMLUtils.SAMLObjectToString(authnRequest));     redirectURL = messageEncoder.encode(authnRequest, idpUrl, request.getRequestURI());      HttpServletResponseAdapter responseAdapter =                      new HttpServletResponseAdapter(servletResponse, request.isSecure());     HTTPTransportUtils.addNoCacheHeaders(responseAdapter);     HTTPTransportUtils.setUTF8Encoding(responseAdapter);     responseAdapter.sendRedirect(redirectURL);    }    private static class SAMLAuthnRequestBuilder {      public AuthnRequest buildRequest(String spProviderId, String acsUrl, String idpUrl){       \/* Building Issuer object *\/       IssuerBuilder issuerBuilder = new IssuerBuilder();       Issuer issuer =                      issuerBuilder.buildObject(&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;,                                                 &quot;Issuer&quot;, &quot;saml2p&quot;);       issuer.setValue(spProviderId);              \/* Creation of AuthRequestObject *\/       DateTime issueInstant = new DateTime();       AuthnRequestBuilder authRequestBuilder = new AuthnRequestBuilder();        AuthnRequest authRequest =                     authRequestBuilder.buildObject(SAMLConstants.SAML20P_NS,                             &quot;AuthnRequest&quot;, &quot;saml2p&quot;);       authRequest.setForceAuthn(false);       authRequest.setIssueInstant(issueInstant);       authRequest.setProtocolBinding(SAMLConstants.SAML2_POST_BINDING_URI);       authRequest.setAssertionConsumerServiceURL(acsUrl);       authRequest.setIssuer(issuer);       authRequest.setNameIDPolicy(nameIdPolicy);       authRequest.setVersion(SAMLVersion.VERSION_20);       authRequest.setDestination(idpUrl);        return authRequest;     }   }    private static class MessageEncoder extends HTTPRedirectDeflateEncoder {     public String encode(SAMLObject message, String endpointURL, String relayState)                                           throws MessageEncodingException {       String encodedMessage = deflateAndBase64Encode(message);       return buildRedirectURL(endpointURL, relayState, encodedMessage);     }     public String buildRedirectURL(String endpointURL, String relayState, String message)                                                         throws MessageEncodingException {       URLBuilder urlBuilder = new URLBuilder(endpointURL);       List&lt;Pair&lt;String, String&gt;&gt; queryParams = urlBuilder.getQueryParams();       queryParams.clear();       queryParams.add(new Pair&lt;String, String&gt;(&quot;SAMLRequest&quot;, message));       if (checkRelayState(relayState)) {          queryParams.add(new Pair&lt;String, String&gt;(&quot;RelayState&quot;, relayState));       }       return urlBuilder.buildURL();     }   }  } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  SAML 2.0-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 \u043f\u043e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 buildRequest \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f XML \u043e\u0431\u044a\u0435\u043a\u0442: <\/p>\n<pre><code class=\"xml\">&lt;saml2p:AuthnRequest xmlns:saml2p=&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;      AssertionConsumerServiceURL=&quot;https:\/\/sp.local.ru:8443\/sso\/acs&quot;      Destination=&quot;https:\/\/idp.local.ru:8443\/idp\/profile\/SAML2\/Redirect\/SSO&quot;       ForceAuthn=&quot;false&quot;      ID=&quot;_0ddb303f9500839762eabd30e7b1e3c28b596c69&quot;       IssueInstant=&quot;2013-09-12T09:46:41.882Z&quot;      ProtocolBinding=&quot;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST&quot; Version=&quot;2.0&quot;&gt;     &lt;saml2p:Issuer          xmlns:saml2p=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;&gt;sp.local.ru&lt;\/saml2p:Issuer&gt; &lt;\/saml2p:AuthnRequest&gt; <\/code><\/pre>\n<p>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <i>AssertionConsumerServiceURL<\/i> \u0437\u0430\u0434\u0430\u0435\u0442 URL, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 shibboleth idP \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442, \u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <i>ProtocolBinding<\/i> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043d\u0430\u0448\u0435\u043c\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0443 (POST \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 HTTP)<br \/>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 ID \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f <br \/>  <i>String key = SAMLRequestStore.getInstance().storeRequest();<\/i><br \/>  \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0437\u0431\u043e\u0440\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <i>verifyInResponseTo<\/i> \u043a\u043b\u0430\u0441\u0441\u0430 <i>SAMLResponseVerifier<\/i>.<\/p>\n<p>  \u042d\u043b\u0435\u043c\u0435\u043d\u0442 saml2p:Issuer \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0438\u043c\u044f \u043d\u0430\u0448\u0435\u0433\u043e SP. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <i>saml2p:Issuer <\/i>shibboleth idP \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043e\u0442 \u043a\u0430\u043a\u043e\u0433\u043e SP \u043f\u0440\u0438\u0441\u043b\u0430\u043d \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e, \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c (\u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u0430\u0434\u0430\u0442\u0443 SP). <\/p>\n<p>  \u0412 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0435 \u0432\u044b\u0448\u0435 SAML 2.0 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 idP \u0432 \u0432\u0438\u0434\u0435 SAML 2.0 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 XML \u0444\u043e\u0440\u043c\u0430\u0442\u0435: <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;source lang=&quot;xml&quot;&gt; &lt;saml2p:Response xmlns:saml2p=&quot;urn:oasis:names:tc:SAML:2.0:protocol&quot;       Destination=&quot;https:\/\/sp.local.ru:8443\/sso\/acs&quot;       ID=&quot;_9c5e6028df334510cce22409ddbca6ac&quot;      InResponseTo=&quot;_0ddb303f9500839762eabd30e7b1e3c28b596c69&quot;       IssueInstant=&quot;2013-09-12T10:13:35.177Z&quot; Version=&quot;2.0&quot;&gt;    &lt;saml2:Issuer xmlns:saml2=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;               Format=&quot;urn:oasis:names:tc:SAML:2.0:nameid-format:entity&quot;&gt;                             https:\/\/idp.local.ru\/idp\/shibboleth    &lt;\/saml2:Issuer&gt; &lt;saml2p:Status&gt;     &lt;saml2p:StatusCode Value=&quot;urn:oasis:names:tc:SAML:2.0:status:Success&quot;\/&gt; &lt;\/saml2p:Status&gt; &lt;saml2:Assertion xmlns:saml2=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot;      ID=&quot;_0a299e86f4b17b5e047735121a880ccb&quot; IssueInstant=&quot;2013-09-12T10:13:35.177Z&quot;       version=&quot;2.0&quot;&gt;     &lt;saml2:Issuer Format=&quot;urn:oasis:names:tc:SAML:2.0:nameid-format:entity&quot;&gt;           https:\/\/idp.local.ru\/idp\/shibboleth     &lt;\/saml2:Issuer&gt;     &lt;saml2:Subject&gt;       &lt;saml2:NameID Format=&quot;urn:oasis:names:tc:SAML:2.0:nameid-format:transient&quot;          NameQualifier=&quot;https:\/\/idp.local.ru\/idp\/shibboleth&quot;&gt;         _f1de09ee54294d4b5ddeb3aa5e6d2aab       &lt;\/saml2:NameID&gt;       &lt;saml2:SubjectConfirmation Method=&quot;urn:oasis:names:tc:SAML:2.0:cm:bearer&quot;&gt;         &lt;saml2:SubjectConfirmationData Address=&quot;127.0.0.1&quot;           InResponseTo=&quot;_0ddb303f9500839762eabd30e7b1e3c28b596c69&quot;            NotOnOrAfter=&quot;2013-09-12T10:18:35.177Z&quot;            Recipient=&quot;https:\/\/sp.local.ru:8443\/sso\/acs&quot;\/&gt;       &lt;\/saml2:SubjectConfirmation&gt;     &lt;\/saml2:Subject&gt;     &lt;saml2:Conditions           NotBefore=&quot;2013-09-12T10:13:35.177Z&quot;           NotOnOrAfter=&quot;2013-09-12T10:18:35.177Z&quot;&gt;         &lt;saml2:AudienceRestriction&gt;             &lt;saml2:Audience&gt;sp.local.ru&lt;\/saml2:Audience&gt;         &lt;\/saml2:AudienceRestriction&gt;     &lt;\/saml2:Conditions&gt;     &lt;saml2:AuthnStatement AuthnInstant=&quot;2013-09-12T10:13:35.137Z&quot;                SessionIndex=&quot;_91826738984ca8bef18a8450135b1821&quot;&gt;         &lt;saml2:SubjectLocality Address=&quot;127.0.0.1&quot;\/&gt;         &lt;saml2:AuthnContext&gt;           &lt;saml2:AuthnContextClassRef&gt;             urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport           &lt;\/saml2:AuthnContextClassRef&gt;         &lt;\/saml2:AuthnContext&gt;     &lt;\/saml2:AuthnStatement&gt;  &lt;saml2:AttributeStatement&gt;         &lt;saml2:Attribute Name=&quot;userLogin&quot; NameFormat=&quot;urn:oasis:names:tc:SAML:2.0:attrname-format:uri&quot;&gt;             &lt;saml2:AttributeValue xmlns:xs=&quot;http:\/\/www.w3.org\/2001\/XMLSchema&quot; xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:type=&quot;xs:string&quot;&gt;idpuser&lt;\/saml2:AttributeValue&gt;         &lt;\/saml2:Attribute&gt;     &lt;\/saml2:AttributeStatement&gt; &lt;\/saml2:Assertion&gt; &lt;\/saml2p:Response&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043e \u0432 \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 SAMLResponseVerifier.verify(..)<br \/>  \u0412\u043e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0432\u0441\u0435, \u043d\u0430\u0448 \u0444\u0438\u043b\u044c\u0442\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d! <br \/>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a: <br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/d32\/10b\/1e8\/d3210b1e849e5ef694f5b075aed72f28.png\"\/><\/p>\n<p>  \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 \u0432 jar \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439. <br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 <i>pom.xml: mvn clean install<\/i> <\/p>\n<h5>6. \u0421\u043e\u0437\u0434\u0430\u0435\u043c Java Web \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 SSO<\/h5>\n<p>  <\/p>\n<h6>\u0421\u043e\u0437\u0434\u0430\u0435\u043c Java Web \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <\/h6>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 Java Web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c\u0438 \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438. \u0414\u043e\u0441\u0442\u0443\u043f \u0434\u043e \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Shibboleth idP. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u044b. <br \/>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/2ef\/1f2\/3b9\/2ef1f23b97fe49eeb6a9d68aedc80c10.png\"\/><\/p>\n<p>  <b>pom.xml<\/b><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;project xmlns=&quot;http:\/\/maven.apache.org\/POM\/4.0.0&quot;    xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;   xsi:schemaLocation=&quot;http:\/\/maven.apache.org\/POM\/4.0.0    http:\/\/maven.apache.org\/maven-v4_0_0.xsd&quot;&gt;  &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt; &lt;groupId&gt; ru.eastbanctech.web&lt;\/groupId&gt; &lt;artifactId&gt;SimpleSSOApplication&lt;\/artifactId&gt; &lt;packaging&gt;war&lt;\/packaging&gt; &lt;version&gt;1.0-SNAPSHOT&lt;\/version&gt; &lt;name&gt;SimpleSSOApplication&lt;\/name&gt; &lt;url&gt;http:\/\/maven.apache.org&lt;\/url&gt;  &lt;!-- \u0417\u0430\u0434\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f  --&gt; &lt;properties&gt;   &lt;sp.id&gt;sp.local.ru&lt;\/sp.id&gt;   &lt;acs.url&gt;https:\/\/sp.local.ru:8443\/sso\/acs&lt;\/acs.url&gt;   &lt;idp.sso.url&gt;https:\/\/idp.local.ru:8443\/idp\/profile\/SAML2\/Redirect\/SSO&lt;\/idp.sso.url&gt;   &lt;logout.url&gt;\/logout&lt;\/logout.url&gt; &lt;\/properties&gt;  &lt;dependencies&gt;   &lt;dependency&gt;     &lt;groupId&gt;javax.servlet&lt;\/groupId&gt;     &lt;artifactId&gt;servlet-api&lt;\/artifactId&gt;     &lt;version&gt;2.5&lt;\/version&gt;    &lt;\/dependency&gt;    &lt;dependency&gt;      &lt;groupId&gt; ru.eastbanctech.web&lt;\/groupId&gt;      &lt;artifactId&gt;saml-sp-filter&lt;\/artifactId&gt;      &lt;version&gt;1.0-SNAPSHOT&lt;\/version&gt;    &lt;\/dependency&gt;&lt;sup&gt;8&lt;\/sup&gt;     &lt;dependency&gt;      &lt;groupId&gt;org.slf4j&lt;\/groupId&gt;      &lt;artifactId&gt;slf4j-api&lt;\/artifactId&gt;      &lt;version&gt;1.7.1&lt;\/version&gt;    &lt;\/dependency&gt;    &lt;dependency&gt;      &lt;groupId&gt;org.slf4j&lt;\/groupId&gt;      &lt;artifactId&gt;slf4j-log4j12&lt;\/artifactId&gt;      &lt;version&gt;1.7.1&lt;\/version&gt;    &lt;\/dependency&gt;  &lt;\/dependencies&gt;   &lt;build&gt;    &lt;finalName&gt;sso&lt;\/finalName&gt;    &lt;plugins&gt;      &lt;plugin&gt;        &lt;artifactId&gt;maven-war-plugin&lt;\/artifactId&gt;        &lt;configuration&gt;          &lt;webResources&gt;            &lt;resource&gt;              &lt;filtering&gt;true&lt;\/filtering&gt;              &lt;directory&gt;src\/main\/webapp\/WEB-INF&lt;\/directory&gt;              &lt;targetPath&gt;WEB-INF&lt;\/targetPath&gt;              &lt;includes&gt;                &lt;include&gt;**\/*.xml&lt;\/include&gt;              &lt;\/includes&gt;            &lt;\/resource&gt;          &lt;\/webResources&gt;        &lt;\/configuration&gt;      &lt;\/plugin&gt;    &lt;\/plugins&gt;  &lt;\/build&gt;   &lt;\/project&gt;   <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0443\u0442 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0430 \u0441\u0435\u043a\u0446\u0438\u044e <i>properties<\/i>, \u0433\u0434\u0435 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430<br \/>  <i> &lt;sp.id&gt;sp.local.ru&lt;\/sp.id&gt;<\/i> \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 SAML 2.0 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 SP<br \/>   <i>&lt;acs.url&gt;https:\/\/sp.local.ru:8443\/sso\/acs&lt;\/acs.url&gt;<\/i> \u2014 URL \u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043e\u043d <br \/>   \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c SAML 2.0 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 shibboleth idP<br \/>   <i>&lt;idp.sso.url&gt;https:\/\/idp.local.ru:8443\/idp\/profile\/SAML2\/Redirect\/SSO&lt;\/idp.sso.url&gt;<\/i> \u2014 URL, \u043f\u043e <br \/>   \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043d\u0430\u0448 \u0444\u0438\u043b\u044c\u0442\u0440 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f shibboleth idP<br \/>   <i>&lt;logout.url&gt;\/logout&lt;\/logout.url&gt;<\/i> \u2014 logout URL<\/p>\n<p>  <b>web.xml<\/b><\/p>\n<p>  \u0412 web.xml \u0444\u0430\u0439\u043b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0435\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 &quot;.jpg&quot; \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <i>excludedUrlPattern<\/i>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">&lt;!DOCTYPE web-app PUBLIC  &quot;-\/\/Sun Microsystems, Inc.\/\/DTD Web Application 2.3\/\/EN&quot;  &quot;http:\/\/java.sun.com\/dtd\/web-app_2_3.dtd&quot; &gt; &lt;web-app&gt;   &lt;display-name&gt;Simple SSO Java Web Application&lt;\/display-name&gt;7.   &lt;filter&gt;     &lt;filter-name&gt;SSOFilter&lt;\/filter-name&gt;     &lt;filter-class&gt; ru.eastbanctech.java.web.filter.saml.SAMLSPFilter&lt;\/filter-class&gt;     &lt;init-param&gt;       &lt;param-name&gt;excludedUrlPattern&lt;\/param-name&gt;       &lt;param-value&gt;.*\\.jpg&lt;\/param-value&gt;    &lt;\/init-param&gt;    &lt;init-param&gt;      &lt;param-name&gt;idProviderSSOUrl&lt;\/param-name&gt;      &lt;param-value&gt; ${idp.sso.url}&lt;\/param-value&gt;    &lt;\/init-param&gt;    &lt;init-param&gt;      &lt;param-name&gt;spProviderId&lt;\/param-name&gt;      &lt;param-value&gt;${sp.id}&lt;\/param-value&gt;    &lt;\/init-param&gt;    &lt;init-param&gt;      &lt;param-name&gt;acsUrl&lt;\/param-name&gt;      &lt;param-value&gt;${acs.url}&lt;\/param-value&gt;    &lt;\/init-param&gt;    &lt;init-param&gt;      &lt;param-name&gt;logoutUrl&lt;\/param-name&gt;      &lt;param-value&gt;${logout.url}&lt;\/param-value&gt;    &lt;\/init-param&gt;  &lt;\/filter&gt;  &lt;filter-mapping&gt;    &lt;filter-name&gt;SSOFilter&lt;\/filter-name&gt;    &lt;url-pattern&gt;\/pages\/private\/*&lt;\/url-pattern&gt;  &lt;\/filter-mapping&gt;   &lt;filter-mapping&gt;    &lt;filter-name&gt;SSOFilter&lt;\/filter-name&gt;    &lt;url-pattern&gt;${logout.url}&lt;\/url-pattern&gt;  &lt;\/filter-mapping&gt;   &lt;filter-mapping&gt;    &lt;filter-name&gt;SSOFilter&lt;\/filter-name&gt;    &lt;url-pattern&gt;\/acs&lt;\/url-pattern&gt;  &lt;\/filter-mapping&gt; &lt;\/web-app&gt;  <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <b>private\/page.jsp<\/b><\/p>\n<p>  \u0421\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0432\u043e\u0434 id \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"html\">&lt;%@ page import=&quot; ru.eastbanctech.java.web.filter.saml.store.SAMLSessionManager&quot; %&gt; &lt;%@ page import=&quot; ru.eastbanctech.java.web.filter.saml.store.SAMLSessionInfo&quot; %&gt; &lt;%@ page import=&quot;java.util.Map&quot; %&gt; &lt;html&gt; &lt;body&gt; &lt;h2&gt;Private Resource&lt;\/h2&gt; &lt;%       SAMLSessionInfo info =        (SAMLSessionInfo)request.getSession().getAttribute(SAMLSessionManager.SAML_SESSION_INFO);   out.println(&quot;User id = &quot; + info.getNameId() + &quot;  &quot;);   out.println(&quot;&lt;TABLE&gt; &lt;TR&gt; &lt;TH&gt; Attribute name &lt;\/TH&gt; &lt;TH&gt; Attribulte value &lt;\/TH&gt;&lt;\/TR&gt;&quot;);    for (Map.Entry entry : info.getAttributes().entrySet()) {     out.println(&quot;&lt;TR&gt;&lt;TD&gt;&quot; + entry.getKey() + &quot;&lt;\/TD&gt;&lt;TD&gt;&quot; + entry.getValue() + &quot;&lt;\/TD&gt;&lt;\/TR&gt;&quot;);   }   out.println(&quot;&lt;\/TABLE&gt;&quot;); %&gt; &lt;a href=&quot;&lt;%=request.getContextPath()%&gt;\/logout&quot;&gt;Logout&lt;\/a&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439: mvn clean package.<\/p>\n<h5>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 Java Web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h5>\n<p>  \u0414\u0435\u043f\u043b\u043e\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 Tomcat AS \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 SSO:  <\/p>\n<ol>\n<li>\u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 ${tomcatHome}\/conf\/Catalina\/localhost\/sso.xml<br \/> \n<pre><code class=\"java\">&lt;Context docBase=&quot;$pathToWebApp&quot; privileged=&quot;true&quot; antiResourceLocking=&quot;false&quot;         antiJARLocking=&quot;false&quot;    unpackWAR=&quot;false&quot; swallowOutput=&quot;true&quot; \/&gt; <\/code><\/pre>\n<p>  \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 sso.war \u0432 ${tomcatHome}\/webapps<\/li>\n<li>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u043e\u043c\u043a\u0430\u0442\u0430 \u043c\u043e\u0433\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 shibboleth idP \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 HTTPS \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 shibboleth idP \u0432 java keystore.<br \/>   \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f Java \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 keytool:\n<p>  keytool -alias idp.local.ru -importcert -file ${shHome}\/idp.crt -keystore ${keystorePath}<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c Tomcat AS<\/li>\n<li>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0438 \u0441\u0442\u0443\u0447\u0438\u043c\u0441\u044f \u0432 \u0437\u0430\u043a\u0440\u044b\u0442\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f <a href=\"https:\/\/sp.local.ru\">sp.local.ru<\/a>:8443\/sso\/pages\/private\/page.jsp<\/li>\n<li>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u043b\u0430\u0441\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u044b\u0432\u0435\u043b\u0430 id \u0438 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/379\/704\/b1b\/379704b1bf2a28d8767f200f62a05fe8.png\"\/>  <\/li>\n<li>\u041a\u0430\u043a \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0447\u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u043c \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 .jpg \u0432 \u043f\u0430\u043f\u043a\u0435 \/pages\/private.<\/li>\n<\/ol>\n<p>  <\/p>\n<h5>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Google Apps.<\/h5>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 SSO. <br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0445 \u0441\u043b\u0443\u0436\u0431 Google Apps (<a href=\"http:\/\/www.google.com\/enterprise\/apps\/business\/\">http:\/\/www.google.com\/enterprise\/apps\/business\/<\/a>). <\/p>\n<ol>\n<li>\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u0435\u0431\u0435 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u0438 \u0441\u0443\u043f\u0435\u0440-\u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0443\u044e \u043f\u0440\u043e\u0431\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e. \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0432\u0441\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e \u0437\u0430\u0439\u0434\u0438\u0442\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 <a href=\"http:\/\/admin.google.com\/\">admin.google.com\/<\/a> \u043f\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u043b\u043d\u043e\u0435 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f).<\/li>\n<li>\u041f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043d\u0435\u043b\u044c\u044e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f idpuser, \u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u043f\u0440\u0430\u0432\u043e Super Administrator.<\/li>\n<li>\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0432\u043d\u0438\u0437\u0443 \u044d\u043a\u0440\u0430\u043d\u0430 \u00ab\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u00bb \u0438 \u0432 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435 \u043d\u0430\u0436\u0430\u0442\u044c <br \/>  \u043d\u0430 \u043f\u0443\u043d\u043a\u0442 \u00ab\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u00bb.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/7ad\/ad9\/639\/7adad9639f6e64572419ca91b7e6e9c0.png\"\/>  <\/li>\n<li>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 -&gt; \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0434\u0438\u043d\u044b\u0439 \u0432\u0445\u043e\u0434.<\/li>\n<li>\u041e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043f\u0443\u043d\u043a\u0442 \u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0435\u0434\u0438\u043d\u044b\u0439 \u0432\u0445\u043e\u0434 \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: <br \/>  <i>URL \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b * <\/i>= <a href=\"https:\/\/idp.local.ru:8443\/idp\/profile\/SAML2\/Redirect\/SSO\">https:\/\/idp.local.ru:8443\/idp\/profile\/SAML2\/Redirect\/SSO<\/a><br \/>  <i>URL \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432\u044b\u0445\u043e\u0434\u0430 *<\/i> = gmail.com<br \/>  <i>\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c URL *<\/i> = gmail.com\n<p>  \u041d\u0430\u0436\u0430\u0442\u044c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 <i>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/i>.<\/li>\n<li>\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 shibboleth idP \u043f\u043e HTTPS<br \/>  \u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <i>$shHome\/credentials\/idp.crt<\/i><br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/301\/7fd\/1ab\/3017fd1ab7f55290587fc1031c1bba9e.png\"\/>\n<p>  \u041d\u0430\u0436\u0430\u0442\u044c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/li>\n<li>\u041f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 <a href=\"https:\/\/shibboleth.usc.edu\/docs\/google-apps\/\">https:\/\/shibboleth.usc.edu\/docs\/google-apps\/<\/a> \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c shibboleth idP \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 Google Apps.\n<p>  <b>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0439\u0442\u0435 \u0438\u043c\u044f \u0441\u0445\u0435\u043c\u044b \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0438\u043d\u0430\u0447\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 shibboleth idP. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043c\u0435\u0441\u0442\u043e RelyingParty \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c rp:RelyingParty.<\/b><\/li>\n<li>\u0414\u043b\u044f logger\u2019\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c edu.internet2.middleware.shibboleth \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0443\u0440\u043e\u0432\u0435\u043d\u044c DEBUG<br \/> \n<pre><code class=\"java\">    &lt;!-- Logs IdP, but not OpenSAML, messages --&gt;     &lt;logger name=&quot;edu.internet2.middleware.shibboleth&quot; level=&quot;DEBUG&quot;\/&gt; <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c shibboleth idP \u0438 \u0438\u0434\u0435\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <a href=\"https:\/\/admin.google.com\">https:\/\/admin.google.com<\/a> \u0432 \u043d\u043e\u0432\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u0431\u0440\u043e\u0443\u0437\u0435\u0440\u0430 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u0443\u043a\u043e\u0432, \u0432 Google Chrome \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0436\u0438\u043c \u0418\u043d\u043a\u043e\u0433\u043d\u0438\u0442\u043e).<br \/>  \u0412\u0432\u043e\u0434\u0438\u043c idpuser@<font color=\"red\">domain_name<\/font>, \u0433\u0434\u0435 domain_name \u2013 \u0438\u043c\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 \u0438 \u043f\u0430\u0440\u043e\u043b\u044c. \u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u00ab\u0412\u043e\u0439\u0442\u0438\u00bb.<br \/>  \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u043d\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u0438 \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u0432\u044b \u0432\u043e\u0448\u043b\u0438 \u0432 google apps \u043f\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c idpuser.<br \/>  \u0412 \u043b\u043e\u0433\u0435 <i>${shHome}\/logs\/idp-process.log<\/i> \u0448\u0438\u0431\u0431\u043e\u043b\u0435\u0442\u0430 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a shibboleth idP \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441. \u0422\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 <i>RemoteUserLoginHandler<\/i>   <\/p>\n<pre><code class=\"java\">22:19:49.172 - DEBUG [edu.internet2.middleware.shibboleth.idp.authn.provider.RemoteUserLoginHandler:66] - Redirecting to &lt;a href=&quot;https:\/\/idp.local.ru:8443\/idp\/Authn\/RemoteUser&quot;&gt;https:\/\/idp.local.ru:8443\/idp\/Authn\/RemoteUser&lt;\/a&gt;  <\/code><\/pre>\n<p>  \u0412\u043e\u043e\u0431\u0449\u0435 \u043b\u043e\u0433\u0438 \u0432 shibboleth idP \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438 \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0435. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0438\u0445. <br \/>  \u0414\u0430\u043b\u0435\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u0440\u043b\u0443 <a href=\"https:\/\/sp.local.ru\">sp.local.ru<\/a>:8443\/sso\/pages\/private\/page.jsp <br \/>  \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u043b\u043e\u0433\u0430\u0445, \u0447\u0442\u043e shibboleth idP \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0438\u043c\u0435\u044e\u0449\u0443\u044e\u0441\u044f \u0441\u0435\u0441\u0441\u0438\u044e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f idpuser.<\/p>\n<p>  \u041d\u0443 \u0432\u043e\u0442 \u0438 \u0432\u0441\u0435. \u041d\u0430\u0448\u0430 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 SSO \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442. \u041d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u0432\u044b \u043d\u0430\u0448\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u0434\u043b\u044f \u0441\u0435\u0431\u044f. <\/p>\n<h5>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u044f<\/h5>\n<p>  <sup>1<\/sup> \u2014 \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Service Provider \u043e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044f. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 Shibboleth \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 Apache-\u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0435\u0440\u0435\u0434 Application Server\u2019\u043e\u043c. <br \/>  <sup>2<\/sup> \u2014 \u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f Shibboleth idP 2.4.0<br \/>  <sup>3<\/sup> \u2014 \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 Java 7 \u0432 \u0441\u0432\u043e\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438. <br \/>  <sup>4<\/sup> \u2014 \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 CentOS 6.3 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 OS. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0430\u0441\u044c \u043d\u0430 Ubuntu 12.04.<br \/>  <sup>5<\/sup> \u2014 \u0414\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 servlet-api 2.5 \u0438 ${tomcatHome}\/lib\/catalina.jar<br \/>  <sup>6<\/sup> \u2014 ru.eastbanctech.java.web.RemoteUserValve \u2013 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u0434\u043e \u043a\u043b\u0430\u0441\u0441\u0430 RemoteUserValve. \u0412 \u0432\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<br \/>  <sup>7<\/sup> \u2014 \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u044f.<br \/>  <sup>8<\/sup> \u2014 \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h5>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<br \/>  <\/h5>\n<p>  <\/p>\n<ol>\n<li><a href=\"https:\/\/developers.google.com\/google-apps\/sso\/saml_reference_implementation\">https:\/\/developers.google.com\/google-apps\/sso\/saml_reference_implementation<\/a> \u2014 SSO \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f Google Apps. \u041e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c SSO \u0432 Google Docs \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 SAML.<\/li>\n<li><a href=\"https:\/\/shibboleth.usc.edu\/docs\/google-apps\/\">https:\/\/shibboleth.usc.edu\/docs\/google-apps\/<\/a> \u2014 \u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Shibboleth \u0441 Google docs.<\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/7553967\/getting-a-value-from-httpservletrequest-getremoteuser-in-tomcat-without-modify\">http:\/\/stackoverflow.com\/questions\/7553967\/getting-a-value-from-httpservletrequest-getremoteuser-in-tomcat-without-modify <\/a> \u2014 \u041a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 Tomcat Valve<\/li>\n<li><a href=\"https:\/\/wiki.shibboleth.net\/confluence\/display\/SHIB2\/Home\">https:\/\/wiki.shibboleth.net\/confluence\/display\/SHIB2\/Home<\/a> \u2014 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e Shibboleth<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/eastbanctech\/blog\/193662\/\"> http:\/\/habrahabr.ru\/company\/eastbanctech\/blog\/193662\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h5>1. \u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h5>\n<p>  \u041d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 (Single Sign On, SSO) \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0435\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u0430\u043c\u044b\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0426\u0435\u043b\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 Service Provider <sup>1<\/sup> (SP) \u0434\u043b\u044f SAML 2.0 identity provider (idP) \u0438 \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 SSO \u0432 Java Web \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. <\/p>\n<p>  \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0431\u044b\u043b\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0440\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0440\u0443\u043f\u043d\u043e\u0433\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (\u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438) \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0435\u0434\u0438\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c:<\/p>\n<ol>\n<li>Liferay version 6.1.20-ee-ga2.<\/li>\n<li>\u041f\u0440\u043e\u0441\u0442\u043e\u0435 java web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/li>\n<li>Google apps.<\/li>\n<\/ol>\n<p>  <u>\u0421\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u0431\u044b\u043b\u0438 \u0432\u044b\u0434\u0432\u0438\u043d\u0443\u0442\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f SSO:<\/u>  <\/p>\n<ol>\n<li>\u0414\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f SSO \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b SAML 2.0.<\/li>\n<li>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 Jasig CAS \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c.<\/li>\n<li>LDAP \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/li>\n<\/ol>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 idP \u0440\u0435\u0448\u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Shibboleth (<a href=\"http:\/\/shibboleth.net\/about\/index.html\">http:\/\/shibboleth.net\/about\/index.html<\/a>) \u043a\u0430\u043a open source-\u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0443\u044e \u0432 \u043f\u043e\u043b\u043d\u043e\u043c \u043e\u0431\u044a\u0435\u043c\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b SAML 1.0 &#038;&#038; SAML 2.0. <\/p>\n<p>  <u>\u0421\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043f\u0440\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438:<\/u><\/p>\n<ol>\n<li>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u0438\u0437\u044b \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c SAML 2.0 \u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u043c Shibboleth.<\/li>\n<li>\u0421\u044b\u0440\u0430\u044f \u0438 \u0435\u0449\u0435 \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e Shibboleth \u043e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044f. <\/li>\n<li>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043f\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Service Provider\u2019\u0430 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 SSO \u0432 \u0441\u0432\u043e\u0435 Java Web-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/li>\n<\/ol>\n<p>  \u041f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0431\u0430\u0440\u044c\u0435\u0440\u043e\u0432 \u0438 \u0441\u0442\u0430\u043b\u043e \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438, \u043f\u043e\u043c\u043e\u0447\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c SAML 2.0.<\/p>\n<h5>2. \u0414\u043b\u044f \u043a\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044f?<\/h5>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u044e:  <\/p>\n<ol>\n<li>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e SSO \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 SAML 2.0.<\/li>\n<li>Java-\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0443\u0436\u0435\u043d \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 \u0441\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 SSO \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 SAML 2.0.<\/li>\n<li>Java-\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0442\u044f\u0442 \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 SSO Identity Provider\u2019\u0430 (idP) \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Shibboleth.<\/li>\n<\/ol>\n<p>  \u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 SAML 2.0. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-193662","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/193662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=193662"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/193662\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=193662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=193662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=193662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}