{"id":458696,"date":"2025-05-06T03:01:14","date_gmt":"2025-05-06T03:01:14","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=458696"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=458696","title":{"rendered":"<span>OpenAM \u0438 Zero Trust: \u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0434\u043e\u0432\u0435\u0440\u0438\u044f \u0433\u043b\u0430\u0441\u0438\u0442: \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u0432\u0435\u0440\u044f\u0439, \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439 (Never trust, always verify). \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c\u00a0<a href=\"https:\/\/github.com\/OpenIdentityPlatform\/OpenAM\" rel=\"noopener noreferrer nofollow\">OpenAM<\/a>\u00a0\u0438\u00a0<a href=\"https:\/\/github.com\/OpenIdentityPlatform\/OpenIG\" rel=\"noopener noreferrer nofollow\">OpenIG<\/a>.<\/p>\n<p>\u0423\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041f\u0440\u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0438 \u043f\u043b\u0430\u0442\u0435\u0436\u0430 \u0431\u0430\u043d\u043a \u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0445\u043e\u0447\u0435\u0442 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u044b, \u0430 \u043d\u0435 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u043d \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0430\u043c \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 PUSH \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430.<\/p>\n<p>\u041a\u0430\u043a \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0431\u0438\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043e\u043a \u043f\u0430\u043b\u044c\u0446\u0430, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 Microsoft Authenticator \u0438\u043b\u0438 Google Authenticator.<\/p>\n<h3>\u0414\u0438\u0437\u0430\u0439\u043d \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0412 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f 3 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:<\/p>\n<ul>\n<li>\n<p><strong>\u0417\u0430\u0449\u0438\u0449\u0430\u0435\u043c\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/strong>\u00a0(\u043b\u044e\u0431\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Node.JS) \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u0441 \u0434\u0432\u0443\u043c\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438: \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u0435\u0440\u0432\u0438\u0441 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 (OpenAM)<\/strong>: \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/p>\n<\/li>\n<li>\n<p><strong>\u0428\u043b\u044e\u0437 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 (OpenIG)<\/strong>: \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 OpenAM \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0445\u0430, \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u043c\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e. \u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0441 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439, OpenAM \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u0441 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u0434\u043e\u043c \u0438 \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435 20 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0430\u0440\u043e\u043b\u0438, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Time-based_one-time_password\" rel=\"noopener noreferrer nofollow\">\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443 TOTP<\/a>\u00a0\u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u00a0<a href=\"https:\/\/support.microsoft.com\/en-us\/account-billing\/download-microsoft-authenticator-351498fc-850a-45da-b7b6-27e523b8702a\" rel=\"noopener noreferrer nofollow\">Microsoft Authenticator<\/a>\u00a0\u0438\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u00a0<a href=\"https:\/\/support.google.com\/accounts\/answer\/1066447\" rel=\"noopener noreferrer nofollow\">Google Authenticator<\/a>.<\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h3>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435\u00a0<a href=\"https:\/\/github.com\/OpenIdentityPlatform\/openam-openig-otp-example\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/OpenIdentityPlatform\/openam-openig-otp-example<\/a><\/p>\n<h4>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 hosts<\/h4>\n<p>\u041f\u0443\u0441\u0442\u044c \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442\u00a0<code>openam.example.org<\/code>\u00a0, \u0430 \u0434\u043b\u044f \u0448\u043b\u044e\u0437\u0430 &#8212;\u00a0<code>openig.example.org<\/code>\u00a0\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0438\u043c\u0435\u043d\u0430 \u0445\u043e\u0441\u0442\u043e\u0432 \u0438 IP \u0430\u0434\u0440\u0435\u0441 \u0432 \u0444\u0430\u0439\u043b\u00a0<code>hosts<\/code>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\u00a0<code>127.0.0.0.1 openam.example.org openig.example.org<\/code><\/p>\n<p>\u0412 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c\u00a0<strong>Windows<\/strong>\u00a0\u0444\u0430\u0439\u043b\u00a0<code>hosts<\/code>\u00a0\u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432\u00a0<code>C:Windows\/System32\/drivers\/etc\/hosts<\/code>, \u0430 \u0432\u00a0<strong>Linux<\/strong>\u00a0\u0438\u00a0<strong>Mac<\/strong>\u00a0\u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432\u00a0<code>\/etc\/hosts<\/code>.<\/p>\n<h4>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430<\/h4>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043d\u0430 \u0432\u0430\u0448\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u00a0<a href=\"https:\/\/support.microsoft.com\/en-us\/account-billing\/download-microsoft-authenticator-351498fc-850a-45da-b7b6-27e523b8702a\" rel=\"noopener noreferrer nofollow\">Microsoft Authenticator<\/a>\u00a0\u0438\u043b\u0438\u00a0<a href=\"https:\/\/support.google.com\/accounts\/answer\/1066447\" rel=\"noopener noreferrer nofollow\">Google Authenticator<\/a>.<\/p>\n<h4>Docker Compose<\/h4>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0432\u0441\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u0447\u0435\u0440\u0435\u0437\u00a0<code>docker compose<\/code>.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u0444\u0430\u0439\u043b\u00a0<code>docker-compose.yml<\/code>\u00a0\u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u043d\u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u00a0<code>services<\/code><\/p>\n<pre><code class=\"yaml\">services: <\/code><\/pre>\n<h3>\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Node.JS \u0441 \u0434\u0432\u0443\u043c\u044f URL:<\/p>\n<ul>\n<li>\n<p><strong>\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u044f(<\/strong><code><strong>\/<\/strong><\/code><strong>)<\/strong>\u00a0&#8212; \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439(<\/strong><code><strong>\/sensitive<\/strong><\/code><strong>)<\/strong>\u00a0&#8212; \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u0441\u0447\u0435\u0442\u0430\u0445 \u0438 \u043a\u043b\u044e\u0447\u0430\u0445 \u043f\u043e\u043b\u044c\u0437\u0432\u043e\u0430\u0442\u0435\u043b\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043f\u043e\u00a0<a href=\"https:\/\/github.com\/OpenIdentityPlatform\/openam-openig-otp-example\/tree\/master\/demo-app\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a><\/p>\n<pre><code class=\"javascript\">const express = require(\"express\"); const app = express(); const port = 3000;  app.set(\"view engine\", \"ejs\");  app.use((req, res, next) =&gt; {     console.log(req.headers)     const token = req.headers.authorization;     if (!token) {         return res.status(401).send(\"Unauthorized\");     }     next() })  app.get(\"\/\", (req, res) =&gt; {     const token = req.headers.authorization;     const jwtPayload = JSON.parse(Buffer.from(token.split('.')[1], 'base64').toString());     const user = { name: jwtPayload.sub };     res.render(\"profile\", { user }); });  app.get(\"\/sensitive\", (req, res) =&gt; {     const sensitiveData = { bankAccount: \"1234-5678-9012-3456\", secretKey: \"MY_SUPER_SECRET_KEY\" };     res.render(\"sensitive\", { sensitiveData }); });  app.listen(port, () =&gt; console.log(`Server running at http:\/\/localhost:${port}`));<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u0444\u0430\u0439\u043b\u00a0<code>docker-compose.yml<\/code>\u00a0\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u00a0<code>services<\/code>\u00a0\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/p>\n<pre><code class=\"yaml\">services:   demo-app:     build: .\/demo-app     container_name: demo-app<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439\u00a0<code>docker compose up -d --build demo-app<\/code><\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0430\u0443\u0442\u0435\u043d\u0438\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAM<\/h3>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u0444\u0430\u0439\u043b\u00a0<code>docker-compose.yml<\/code>\u00a0\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u00a0<code>services<\/code>\u00a0\u0441\u0435\u0440\u0438\u0441 OpenAM:<\/p>\n<pre><code class=\"yaml\">services: ...   openam:     image: openidentityplatform\/openam:latest     container_name: openam     hostname: openam.example.org     ports:       - \"8080:8080\"<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 OpenAM \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439\u00a0<code>docker compose up openam<\/code>. \u0414\u043e\u0436\u0434\u0438\u0442\u0435\u0441\u044c \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">docker exec -w '\/usr\/openam\/ssoconfiguratortools' openam bash -c \\ 'echo \"ACCEPT_LICENSES=true SERVER_URL=http:\/\/openam.example.org:8080 DEPLOYMENT_URI=\/$OPENAM_PATH BASE_DIR=$OPENAM_DATA_DIR locale=en_US PLATFORM_LOCALE=en_US AM_ENC_KEY= ADMIN_PWD=passw0rd AMLDAPUSERPASSWD=p@passw0rd COOKIE_DOMAIN=example.org ACCEPT_LICENSES=true DATA_STORE=embedded DIRECTORY_SSL=SIMPLE DIRECTORY_SERVER=openam.example.org DIRECTORY_PORT=50389 DIRECTORY_ADMIN_PORT=4444 DIRECTORY_JMX_PORT=1689 ROOT_SUFFIX=dc=openam,dc=example,dc=org DS_DIRMGRDN=cn=Directory Manager DS_DIRMGRPASSWD=passw0rd\" &gt; conf.file &amp;&amp; java -jar openam-configurator-tool*.jar --file conf.file'<\/code><\/pre>\n<p>\u0414\u043e\u0436\u0434\u0438\u0442\u0435\u0441\u044c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 MFA \u0432 OpenAM<\/h4>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 OpenAM \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435\u00a0<a href=\"http:\/\/openam.example.org:8080\/openam\" rel=\"noopener noreferrer nofollow\">http:\/\/openam.example.org:8080\/openam<\/a>.<\/p>\n<p>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u044d\u0442\u043e\u00a0<code>amadmin<\/code>\u00a0\u0438\u00a0<code>passw0rd<\/code>\u00a0\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u0439\u0441\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Top Level Realm. \u0412 \u043c\u0435\u043d\u044e \u0441\u043b\u0435\u0432\u0430 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Authentication \u2192 Modules \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c\u00a0<code>totp<\/code>\u00a0\u0441 \u0442\u0438\u043f\u043e\u043c\u00a0<code>Authenticator (OATH)<\/code><\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d05\/af2\/95d\/d05af295d21bdcccdfedc378256a3e2f.png\" alt=\"New TOTP Module.png\" width=\"2350\" height=\"862\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/d05\/af2\/95d\/d05af295d21bdcccdfedc378256a3e2f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d05\/af2\/95d\/d05af295d21bdcccdfedc378256a3e2f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>New TOTP Module.png<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435\u00a0<strong>OATH Algorithm to Use: TOTP<\/strong>, \u0442\u0430\u043a\u0436\u0435 \u0443\u043a\u0430\u0436\u0438\u0442\u0435\u00a0<strong>Name of the Issuer<\/strong>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<strong>OpenAM<\/strong>.\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u00a0<code>totp<\/code>.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b8a\/5fa\/5c3\/b8a5fa5c34ba1da6ec92158cbc1ed911.png\" alt=\"TOTP module settings\" width=\"2338\" height=\"1522\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/b8a\/5fa\/5c3\/b8a5fa5c34ba1da6ec92158cbc1ed911.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b8a\/5fa\/5c3\/b8a5fa5c34ba1da6ec92158cbc1ed911.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>TOTP module settings<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 Top Level Realm, \u0432 \u043c\u0435\u043d\u044e \u0441\u043b\u0435\u0432\u0430 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 Authentication \u2192 Chains \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438\u00a0<code>totp<\/code><\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/330\/26f\/5c9\/33026f5c95db058379642eb0c61e9bb2.png\" alt=\"New TOTP authentication chain\" width=\"2334\" height=\"746\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/330\/26f\/5c9\/33026f5c95db058379642eb0c61e9bb2.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/330\/26f\/5c9\/33026f5c95db058379642eb0c61e9bb2.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>New TOTP authentication chain<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c\u00a0<code>totp<\/code>\u00a0\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/71c\/afb\/6df\/71cafb6dfd4c2e6dd834c288e7af71c4.png\" alt=\"TOTP authentication chain settings\" width=\"2342\" height=\"1448\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/71c\/afb\/6df\/71cafb6dfd4c2e6dd834c288e7af71c4.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/71c\/afb\/6df\/71cafb6dfd4c2e6dd834c288e7af71c4.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>TOTP authentication chain settings<\/figcaption><\/div>\n<\/figure>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 OpenAM \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438\u00a0<code>\/sensitive<\/code>\u00a0\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438\u00a0<code>totp<\/code>, \u043d\u043e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 20 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 OpenAM. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 Top Level Realm. \u0412 \u043c\u0435\u043d\u044e \u0441\u043b\u0435\u0432\u0430 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Authorization \u2192 Policy Sets. \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Default Policy Set. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443\u00a0<code>demo-sensitive<\/code>.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0438\u043f\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 URL \u0438 \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u0440\u0435\u0441\u0443\u0440\u0441, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 Add \u0438 \u0437\u0430\u0442\u0435\u043c Create.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7dc\/713\/578\/7dc71357881b2270f8b45c2c0735c407.png\" alt=\"OpenAM new policy\" width=\"2372\" height=\"1306\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/7dc\/713\/578\/7dc71357881b2270f8b45c2c0735c407.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7dc\/713\/578\/7dc71357881b2270f8b45c2c0735c407.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>OpenAM new policy<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u043d\u0430 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0435 Resources \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435 GET \u0438 POST \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/45b\/270\/c38\/45b270c387b356d7dff926fb9f816a24.png\" alt=\"Policy Actions\" width=\"2344\" height=\"1268\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/45b\/270\/c38\/45b270c387b356d7dff926fb9f816a24.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/45b\/270\/c38\/45b270c387b356d7dff926fb9f816a24.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Policy Actions<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0435 Subjects \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0442\u0438\u043f \u201cAuthenticated Users\u201d.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a40\/fb2\/e40\/a40fb2e4035861094b8a427d6de9c64e.png\" alt=\"Policy Subjects\" width=\"2340\" height=\"1316\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a40\/fb2\/e40\/a40fb2e4035861094b8a427d6de9c64e.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a40\/fb2\/e40\/a40fb2e4035861094b8a427d6de9c64e.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Policy Subjects<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0435 Environments \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 Authentication by Module Chain \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0443\u00a0<code>totp<\/code>.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0b9\/80f\/0ca\/0b980f0ca82c61e9b982e35642148465.png\" alt=\"Policy Environments\" width=\"2340\" height=\"1214\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/0b9\/80f\/0ca\/0b980f0ca82c61e9b982e35642148465.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0b9\/80f\/0ca\/0b980f0ca82c61e9b982e35642148465.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Policy Environments<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0430\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435\u00a0<code>totp<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e 20 \u0441\u0435\u043a\u0443\u043d\u0434. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0432 OpenAM \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043d\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438. \u041d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c OpenAM \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0438\u0437 \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u0412 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043c\u0435\u043d\u044e \u0432 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 Configure \u2192 Global Services. \u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u0435 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0443\u043d\u043a\u0442 Scripting. \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0443 Secondary Configuration.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/576\/8e7\/daf\/5768e7dafe34a70e6457242438b67866.png\" alt=\"Configure Scripting\" width=\"2342\" height=\"1048\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/576\/8e7\/daf\/5768e7dafe34a70e6457242438b67866.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/576\/8e7\/daf\/5768e7dafe34a70e6457242438b67866.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Configure Scripting<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e\u00a0<code>POLICY_CONDITION<\/code>. \u041d\u0430 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0435 Secondary Configurations \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 EngineConfiguration.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4a1\/e8a\/939\/4a1e8a939952fe04a1c810f51db79295.png\" alt=\"Scripting Policy Condition\" width=\"2340\" height=\"568\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/4a1\/e8a\/939\/4a1e8a939952fe04a1c810f51db79295.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4a1\/e8a\/939\/4a1e8a939952fe04a1c810f51db79295.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Scripting Policy Condition<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u0441\u043f\u0438\u0441\u043e\u043a\u00a0<strong>Java class whitelist<\/strong>\u00a0\u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435\u00a0<code>java.time.*<\/code>\u00a0\u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c Groovy \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0438 \u0434\u0430\u0442\u043e\u0439.<\/p>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u0412 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043c\u0435\u043d\u044e \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Realms \u2192 Top Level Realm \u0438 \u0432 \u043c\u0435\u043d\u044e \u0441\u043b\u0435\u0432\u0430 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0443\u043d\u043a\u0442 Scripts. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 Auth Time Policy Condition.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/55b\/1f8\/7cd\/55b1f87cd1c7ac0935e241e9bd3dfd5c.png\" alt=\"New Script\" width=\"2346\" height=\"912\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/55b\/1f8\/7cd\/55b1f87cd1c7ac0935e241e9bd3dfd5c.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/55b\/1f8\/7cd\/55b1f87cd1c7ac0935e241e9bd3dfd5c.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>New Script<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0438\u043f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 &#8212; POLICY_CONDITION. \u042f\u0437\u044b\u043a &#8212; Groovy.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a5a\/1ee\/8b1\/a5a1ee8b170114f2f651ff9068948a91.png\" alt=\"Auth Time Policy Condition\" width=\"2334\" height=\"1702\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a5a\/1ee\/8b1\/a5a1ee8b170114f2f651ff9068948a91.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a5a\/1ee\/8b1\/a5a1ee8b170114f2f651ff9068948a91.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Auth Time Policy Condition<\/figcaption><\/div>\n<\/figure>\n<pre><code class=\"java\">import java.time.Instant; import java.time.temporal.ChronoUnit;  logger.warning(\"Session: \" + session)  def authInstant = session.getProperty(\"authInstant\")  logger.warning(\"Auth time expired at1: \" + authInstant)  def instant = Instant.parse(authInstant) def expired = instant.plus(20, ChronoUnit.SECONDS) if (Instant.now().compareTo(expired) &gt; 0) {   logger.warning(\"Auth time expired at: \" + expired)      authorized = false } else {   authorized = true                 }<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u0412 \u043c\u0435\u043d\u044e \u0441\u043b\u0435\u0432\u0430 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 Authorization \u2192 Policy Sets \u2192 Default Policy Set \u2192 demo-sensitive.<\/p>\n<p>\u041d\u0430 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0435 Environments \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0441 \u0442\u0438\u043f\u043e\u043c Script \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c Auth Time Policy Condition.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/017\/265\/5b6\/0172655b6059e0cd7ccf5f134083ecd0.png\" alt=\"Policy Script\" width=\"2362\" height=\"1360\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/017\/265\/5b6\/0172655b6059e0cd7ccf5f134083ecd0.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/017\/265\/5b6\/0172655b6059e0cd7ccf5f134083ecd0.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Policy Script<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 MFA \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u00a0<code>demo<\/code>. \u042d\u0442\u0430 \u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 OpenAM.<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f OpenAM<\/h4>\n<p>\u0412\u044b\u0439\u0434\u0438\u0442\u0435 \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u0438\u043b\u0438 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u201c\u0418\u043d\u043a\u043e\u0433\u043d\u0438\u0442\u043e\u201d \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435\u00a0<a href=\"http:\/\/openam.example.org:8080\/openam\/XUI\/#login\" rel=\"noopener noreferrer nofollow\">http:\/\/openam.example.org:8080\/openam\/XUI\/#login<\/a><\/p>\n<p>\u0412 \u043f\u043e\u043b\u0435 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0432\u0432\u0435\u0434\u0438\u0442\u0435\u00a0<code>demo<\/code>\u00a0\u0438\u00a0<code>changeit<\/code>\u00a0\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u041e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0447\u043d\u0438\u0442\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435\u00a0<code>totp<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0443\u00a0<a href=\"http:\/\/openam.example.org:8080\/openam\/XUI\/#login\/&amp;service=totp&amp;ForceAuth=true\" rel=\"noopener noreferrer nofollow\">http:\/\/openam.example.org:8080\/openam\/XUI\/#login\/&amp;service=totp&amp;ForceAuth=true<\/a><\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043e\u043a\u043d\u043e \u0441 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b7d\/d88\/44e\/b7dd8844e31d168a10e9a47d66a7c7eb.png\" alt=\"OpenAM Register Device\" width=\"1202\" height=\"730\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/b7d\/d88\/44e\/b7dd8844e31d168a10e9a47d66a7c7eb.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b7d\/d88\/44e\/b7dd8844e31d168a10e9a47d66a7c7eb.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>OpenAM Register Device<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443\u00a0<strong>Register Device<\/strong>\u00a0\u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441 QR \u043a\u043e\u0434\u043e\u043c.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/104\/043\/989\/104043989c6018aebc8694baa3f9fa0a.png\" alt=\"OpenAM QR Code\" width=\"1176\" height=\"870\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/104\/043\/989\/104043989c6018aebc8694baa3f9fa0a.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/104\/043\/989\/104043989c6018aebc8694baa3f9fa0a.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>OpenAM QR Code<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0438 \u043e\u0442\u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0439\u0442\u0435 \u0432 \u043d\u0435\u043c \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0439 QR \u043a\u043e\u0434. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 Login Using Verification Code.<\/p>\n<p>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u0434 \u0438\u0437 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 Submit.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c5f\/0bd\/bef\/c5f0bdbefe183d75dfa204cfba12b3fa.png\" alt=\"OpenAM verification code\" width=\"1194\" height=\"790\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/c5f\/0bd\/bef\/c5f0bdbefe183d75dfa204cfba12b3fa.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c5f\/0bd\/bef\/c5f0bdbefe183d75dfa204cfba12b3fa.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>OpenAM verification code<\/figcaption><\/div>\n<\/figure>\n<p><code>MFA<\/code>\u00a0\u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u00a0<code>demo<\/code>\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0442\u043e\u043a\u0435\u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 JWT<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, OpenAM \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u044e \u0438 \u043f\u0438\u0448\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u0435\u0441\u0441\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0432 cookie \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440. \u041c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c OpenAM, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 OpenIG, \u043c\u043e\u0433\u043b\u0438 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 JWT \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c.<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 OpenAM, \u043a\u0430\u043a \u0431\u044b\u043b\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0440\u0430\u043d\u0435\u0435. \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435\u00a0<strong>Top Level Realm<\/strong>. \u0412 \u043c\u0435\u043d\u044e \u0441\u043b\u0435\u0432\u0430 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435\u00a0<strong>STS<\/strong>. \u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u0435 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u00a0<strong>Rest STS<\/strong>. \u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\"><strong>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430<\/strong><\/p>\n<\/th>\n<th>\n<p align=\"left\"><strong>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/strong><\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Supported Token Transforms<\/p>\n<\/td>\n<td>\n<p align=\"left\">OPENAM-&gt;OPENIDCONNECT;don&#8217;t invalidate interim OpenAM session<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Deployment Url Element<\/p>\n<\/td>\n<td>\n<p align=\"left\">jwt<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">The id of the OpenID Connect Token Provider<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/openam.example.org\/openam\" rel=\"noopener noreferrer nofollow\">https:\/\/openam.example.org\/openam<\/a><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Client secret<\/p>\n<\/td>\n<td>\n<p align=\"left\">changeme<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Confirm client secret<\/p>\n<\/td>\n<td>\n<p align=\"left\">changeme<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">The audience for issued tokens<\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/openam.example.org\/openam\" rel=\"noopener noreferrer nofollow\">https:\/\/openam.example.org\/openam<\/a><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 Rest STS.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 OpenAM \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:\u00a0<a href=\"https:\/\/doc.openidentityplatform.org\/openam\/\" rel=\"noopener noreferrer nofollow\">https:\/\/doc.openidentityplatform.org\/openam\/<\/a><\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0448\u043b\u044e\u0437\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 OpenIG<\/h3>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0435\u0440\u0432\u0438\u0441 OpenIG \u0432 \u0444\u0430\u0439\u043b\u00a0<code>docker-compose.yml<\/code><\/p>\n<pre><code class=\"yaml\">services: ...   openig:     image: openidentityplatform\/openig:latest     container_name: openig     hostname: openig.example.org     volumes:       - .\/openig:\/usr\/local\/openig-config:ro     environment:       CATALINA_OPTS: -Dopenig.base=\/usr\/local\/openig-config -Ddemo.app=http:\/\/demo-app:3000 -Dopenam=http:\/\/openam.example.org:8080\/openam     ports:       - \"8081:8080\"<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\u00a0<code>CATALINA_OPTS<\/code>:<\/p>\n<ul>\n<li>\n<p><code>openig.base<\/code>\u00a0&#8212; \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 OpenIG<\/p>\n<\/li>\n<li>\n<p><code>demo.app<\/code>\u00a0&#8212; URL \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 OpenIG \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441<\/p>\n<\/li>\n<li>\n<p><code>openam<\/code>\u00a0&#8212; URL OpenAM, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 OpenIG \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c JWT.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041e\u0431\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/h4>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0430\u043f\u043a\u0443\u00a0<code>openig-config<\/code>\u00a0\u0438 \u0432 \u043d\u0435\u0439 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u043e\u0434\u043d\u0443 \u043f\u0430\u043f\u043a\u0443\u00a0<code>config<\/code>. \u0412 \u043f\u0430\u043f\u043a\u0435\u00a0<code>config<\/code>\u00a0\u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b\u00a0<code>admin.json<\/code>\u00a0\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=\"json\">{     \"prefix\": \"openig\",     \"mode\": \"PRODUCTION\" }<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0436\u0435 \u043f\u0430\u043f\u043a\u0435 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b\u00a0<code>config.json<\/code>.<\/p>\n<pre><code class=\"json\">{   \"heap\": [     {       \"name\": \"EndpointHandler\",       \"type\": \"DispatchHandler\",       \"config\": {         \"bindings\": [           {             \"handler\": \"ClientHandler\",             \"capture\": \"all\",             \"baseURI\": \"${system['demo.app']}\"           }         ]       }     }   ],   \"handler\": {     \"type\": \"Chain\",     \"config\": {       \"filters\": [         {           \"name\": \"STSFilter\",           \"type\": \"ConditionalFilter\",           \"config\": {             \"condition\": \"${empty contexts.sts.issuedToken and not empty request.cookies['iPlanetDirectoryPro'][0].value}\",             \"delegate\": {               \"type\": \"TokenTransformationFilter\",               \"config\": {                 \"openamUri\": \"${system['openam']}\",                 \"realm\": \"\/\",                 \"instance\": \"jwt\",                 \"from\": \"OPENAM\",                 \"to\": \"OPENIDCONNECT\",                 \"idToken\": \"${request.cookies['iPlanetDirectoryPro'][0].value}\"               }             }           }         },         {           \"name\": \"AuthorizationHeaderFilter\",           \"type\": \"ConditionalFilter\",           \"config\": {             \"condition\": \"${not empty contexts.sts.issuedToken}\",             \"delegate\": {               \"type\": \"HeaderFilter\",               \"config\": {                 \"messageType\": \"REQUEST\",                 \"remove\": [                   \"Authorization\",                   \"JWT\"                 ],                 \"add\": {                   \"Authorization\": [                     \"Bearer ${contexts.sts.issuedToken}\"                   ]                 }               }             }           }         },         {           \"name\": \"AuthenticationRedirectionFilter\",           \"type\": \"ConditionEnforcementFilter\",           \"config\": {             \"condition\": \"${not empty contexts.sts.issuedToken}\",             \"failureHandler\": {               \"type\": \"StaticResponseHandler\",               \"config\": {                 \"status\": 302,                 \"reason\": \"Found\",                 \"headers\": {                   \"Content-Type\": [                     \"application\/json\"                   ],                   \"Location\": [                     \"${system['openam']}\/XUI\/#login&amp;goto=${urlEncode(contexts.router.originalUri)}\"                   ]                 },                 \"entity\": \"{ \\\"Redirect\\\": \\\"${system['openam']}\/XUI\/#login&amp;goto=${urlEncode(contexts.router.originalUri)}\\\"}\"               }             }           }         }       ],       \"handler\": {         \"type\": \"Router\",         \"name\": \"_router\",         \"capture\": \"all\"       }     }   } }<\/code><\/pre>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435\u00a0<code>config.json<\/code>\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u0446\u0435\u043f\u043e\u0447\u043a\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/p>\n<ul>\n<li>\n<p><code>STSFilter<\/code>\u00a0&#8212; \u0435\u0441\u043b\u0438 \u0432 HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0435\u0441\u0442\u044c cookie \u043e\u0442 OpenAM, \u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u043e \u044d\u0442\u043e\u0439 cookie JWT, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/p>\n<\/li>\n<li>\n<p><code>AuthorizationHeaderFilter<\/code>\u00a0&#8212; \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 OpenAM JWT \u0432 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a\u00a0<code>Authorization<\/code>\u00a0\u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u043c\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/p>\n<\/li>\n<li>\n<p><code>AuthenticationRedirectionFilter<\/code>\u00a0&#8212; \u0435\u0441\u043b\u0438 JWT \u043d\u0435\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\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 \u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0432 OpenAM.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043e\u0431\u044a\u0435\u043a\u0442\u0435\u00a0<code>heap<\/code>\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u00a0<code>EndpointHandler<\/code>\u00a0, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 OpenIG \u043a \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e.<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 \u043a \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e<\/h4>\n<p>\u0412 \u043f\u0430\u043f\u043a\u0435\u00a0<code>config<\/code>\u00a0\u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0430\u043f\u043a\u0443\u00a0<code>routes<\/code>\u00a0\u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u00a0<code>10-home.json<\/code><\/p>\n<pre><code class=\"json\">{   \"name\": \"${matches(request.uri.path, '^\/$')}\",   \"condition\": \"${matches(request.uri.path, '^\/$')}\",   \"monitor\": true,   \"timer\": true,   \"handler\": {     \"type\": \"Chain\",     \"config\": {       \"filters\": [],       \"handler\": \"EndpointHandler\"     }   },   \"heap\": [        ] } <\/code><\/pre>\n<p>\u041c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f\u00a0<code>EndpointHandler<\/code>\u00a0, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438\u00a0<code>config.json<\/code>.<\/p>\n<p>\u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043a URL \u0441 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0434\u043b\u044f \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u0444\u0438\u043b\u044c\u0442\u0440 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0437 OpenAM.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u043f\u0430\u043f\u043a\u0443\u00a0<code>routes<\/code>\u00a0\u043c\u0430\u0440\u0448\u0440\u0443\u0442\u00a0<code>20-sensitive.json<\/code><\/p>\n<pre><code class=\"json\">{   \"name\": \"${matches(request.uri.path, '^\/sensitive')}\",   \"condition\": \"${matches(request.uri.path, '^\/sensitive')}\",   \"monitor\": true,   \"timer\": true,   \"handler\": {     \"type\": \"Chain\",     \"config\": {       \"filters\": [         {           \"name\": \"MFAPEPFilter\",           \"type\": \"PolicyEnforcementFilter\",           \"config\": {             \"openamUrl\": \"${system['openam']}\",             \"pepUsername\": \"amadmin\",             \"pepPassword\": \"ampassword\",             \"ssoTokenSubject\": \"${request.cookies['iPlanetDirectoryPro'][0].value}\",             \"failureHandler\": {               \"type\": \"StaticResponseHandler\",               \"config\": {                 \"status\": 403,                 \"headers\": {                   \"Content-Type\": [                     \"application\/json\"                   ]                 },                 \"entity\": \"{ \\\"attributes\\\": \\\"${system['openam']}\/XUI\/#login&amp;service=totp&amp;ForceAuth=true&amp;goto=${urlEncode(contexts.router.originalUri)}\\\"}\"               }             }           },           \"handler\": \"ClientHandler\"         }       ],       \"handler\": \"EndpointHandler\"     }   },   \"heap\": [] }<\/code><\/pre>\n<p>\u041c\u0430\u0440\u0448\u0440\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u00a0<code>MFAPEPFilter<\/code>\u00a0\u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0437 OpenAM. \u0418, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430, \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0441 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 OpenIG \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438:\u00a0<a href=\"https:\/\/doc.openidentityplatform.org\/openig\/\" rel=\"noopener noreferrer nofollow\">https:\/\/doc.openidentityplatform.org\/openig\/<\/a><\/p>\n<h3>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 OpenIG \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439\u00a0<code>docker compose ui openig<\/code>.<\/p>\n<p>\u0412\u044b\u0439\u0434\u0438\u0442\u0435 \u0438\u0437 OpenAM, \u0435\u0441\u043b\u0438 \u0432\u044b \u0432\u0441\u0435 \u0435\u0449\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u044b.<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 URL \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0433\u043e OpenIG:\u00a0<a href=\"http:\/\/openig.example.org:8081\/\" rel=\"noopener noreferrer nofollow\">http:\/\/openig.example.org:8081\/<\/a>. \u0412\u0430\u0441 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442 \u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0432 OpenAM. \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:\u00a0<code>demo<\/code>\u00a0\u0438\u00a0<code>changeit<\/code><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432\u0430\u0441 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u044d\u043a\u0440\u0430\u043d \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e42\/fd5\/b82\/e42fd5b82c24208dc30f584602c56f8c.png\" alt=\"Demo Profile Page\" width=\"1262\" height=\"300\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/e42\/fd5\/b82\/e42fd5b82c24208dc30f584602c56f8c.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e42\/fd5\/b82\/e42fd5b82c24208dc30f584602c56f8c.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Demo Profile Page<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0443\u00a0<strong>Sensitive data<\/strong>. \u0412\u0430\u0441 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442 \u043d\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0441 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0432 OpenAM.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a54\/234\/2f5\/a542342f5d1496968d6f8dba64ffc85b.png\" alt=\"TOTP Verification\" width=\"1176\" height=\"660\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a54\/234\/2f5\/a542342f5d1496968d6f8dba64ffc85b.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a54\/234\/2f5\/a542342f5d1496968d6f8dba64ffc85b.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>TOTP Verification<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u0434 \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 Submit. \u041f\u0440\u0438 \u0443\u0441\u043f\u0435\u0445\u0435, \u0432\u0430\u0441 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c7c\/975\/ea1\/c7c975ea14d486cb371368cc62b97939.png\" alt=\"Demo Sensitive Page\" width=\"1318\" height=\"376\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/c7c\/975\/ea1\/c7c975ea14d486cb371368cc62b97939.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c7c\/975\/ea1\/c7c975ea14d486cb371368cc62b97939.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Demo Sensitive Page<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435 30 \u0441\u0435\u043a\u0443\u043d\u0434 \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. \u0412\u0430\u0441 \u0441\u043d\u043e\u0432\u0430 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442 \u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0441 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043e\u0434\u043e\u043c.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/905824\/\"> https:\/\/habr.com\/ru\/articles\/905824\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u0432 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0434\u043e\u0432\u0435\u0440\u0438\u044f \u0433\u043b\u0430\u0441\u0438\u0442: \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u0432\u0435\u0440\u044f\u0439, \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439 (Never trust, always verify). \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c\u00a0<a href=\"https:\/\/github.com\/OpenIdentityPlatform\/OpenAM\" rel=\"noopener noreferrer nofollow\">OpenAM<\/a>\u00a0\u0438\u00a0<a href=\"https:\/\/github.com\/OpenIdentityPlatform\/OpenIG\" rel=\"noopener noreferrer nofollow\">OpenIG<\/a>.<\/p>\n<p>\u0423\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041f\u0440\u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0438 \u043f\u043b\u0430\u0442\u0435\u0436\u0430 \u0431\u0430\u043d\u043a \u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0445\u043e\u0447\u0435\u0442 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u044b, \u0430 \u043d\u0435 \u0437\u043b\u043e\u0443\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u0438\u043a. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u043d \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0430\u043c \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 PUSH \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430.<\/p>\n<p>\u041a\u0430\u043a \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0431\u0438\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442\u043f\u0435\u0447\u0430\u0442\u043e\u043a \u043f\u0430\u043b\u044c\u0446\u0430, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 Microsoft Authenticator \u0438\u043b\u0438 Google Authenticator.<\/p>\n<h3>\u0414\u0438\u0437\u0430\u0439\u043d \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0412 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f 3 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:<\/p>\n<ul>\n<li>\n<p><strong>\u0417\u0430\u0449\u0438\u0449\u0430\u0435\u043c\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/strong>\u00a0(\u043b\u044e\u0431\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Node.JS) \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u0441 \u0434\u0432\u0443\u043c\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438: \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u0435\u0440\u0432\u0438\u0441 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 (OpenAM)<\/strong>: \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/p>\n<\/li>\n<li>\n<p><strong>\u0428\u043b\u044e\u0437 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 (OpenIG)<\/strong>: \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 OpenAM \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0445\u0430, \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u043c\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e. \u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0441 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439, OpenAM \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u0441 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u0434\u043e\u043c \u0438 \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435 20 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0444\u0430\u043a\u0442\u043e\u0440\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0430\u0440\u043e\u043b\u0438, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/Time-based_one-time_password\" rel=\"noopener noreferrer nofollow\">\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443 TOTP<\/a>\u00a0\u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u00a0<a href=\"https:\/\/support.microsoft.com\/en-us\/account-billing\/download-microsoft-authenticator-351498fc-850a-45da-b7b6-27e523b8702a\" rel=\"noopener noreferrer nofollow\">Microsoft Authenticator<\/a>\u00a0\u0438\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u00a0<a href=\"https:\/\/support.google.com\/accounts\/answer\/1066447\" rel=\"noopener noreferrer nofollow\">Google Authenticator<\/a>.<\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h3>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435\u00a0<a href=\"https:\/\/github.com\/OpenIdentityPlatform\/openam-openig-otp-example\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/OpenIdentityPlatform\/openam-openig-otp-example<\/a><\/p>\n<h4>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 hosts<\/h4>\n<p>\u041f\u0443\u0441\u0442\u044c \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442\u00a0<code>openam.example.org<\/code>\u00a0, \u0430 \u0434\u043b\u044f \u0448\u043b\u044e\u0437\u0430 &#8212;\u00a0<code>openig.example.org<\/code>\u00a0\u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0438\u043c\u0435\u043d\u0430 \u0445\u043e\u0441\u0442\u043e\u0432 \u0438 IP \u0430\u0434\u0440\u0435\u0441 \u0432 \u0444\u0430\u0439\u043b\u00a0<code>hosts<\/code>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\u00a0<code>127.0.0.0.1 openam.example.org openig.example.org<\/code><\/p>\n<p>\u0412 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c\u00a0<strong>Windows<\/strong>\u00a0\u0444\u0430\u0439\u043b\u00a0<code>hosts<\/code>\u00a0\u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432\u00a0<code>C:Windows\/System32\/drivers\/etc\/hosts<\/code>, \u0430 \u0432\u00a0<strong>Linux<\/strong>\u00a0\u0438\u00a0<strong>Mac<\/strong>\u00a0\u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432\u00a0<code>\/etc\/hosts<\/code>.<\/p>\n<h4>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430<\/h4>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u043d\u0430 \u0432\u0430\u0448\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u00a0<a href=\"https:\/\/support.microsoft.com\/en-us\/account-billing\/download-microsoft-authenticator-351498fc-850a-45da-b7b6-27e523b8702a\" rel=\"noopener noreferrer nofollow\">Microsoft Authenticator<\/a>\u00a0\u0438\u043b\u0438\u00a0<a href=\"https:\/\/support.google.com\/accounts\/answer\/1066447\" rel=\"noopener noreferrer nofollow\">Google Authenticator<\/a>.<\/p>\n<h4>Docker Compose<\/h4>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0432\u0441\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u0447\u0435\u0440\u0435\u0437\u00a0<code>docker compose<\/code>.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u0444\u0430\u0439\u043b\u00a0<code>docker-compose.yml<\/code>\u00a0\u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u043d\u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u00a0<code>services<\/code><\/p>\n<pre><code class=\"yaml\">services: <\/code><\/pre>\n<h3>\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Node.JS \u0441 \u0434\u0432\u0443\u043c\u044f URL:<\/p>\n<ul>\n<li>\n<p><strong>\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u044f(<\/strong><code><strong>\/<\/strong><\/code><strong>)<\/strong>\u00a0&#8212; \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438<\/p>\n<\/li>\n<li>\n<p><strong>\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439(<\/strong><code><strong>\/sensitive<\/strong><\/code><strong>)<\/strong>\u00a0&#8212; \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0431\u0430\u043d\u043a\u043e\u0432\u0441\u043a\u0438\u0445 \u0441\u0447\u0435\u0442\u0430\u0445 \u0438 \u043a\u043b\u044e\u0447\u0430\u0445 \u043f\u043e\u043b\u044c\u0437\u0432\u043e\u0430\u0442\u0435\u043b\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043f\u043e\u00a0<a href=\"https:\/\/github.com\/OpenIdentityPlatform\/openam-openig-otp-example\/tree\/master\/demo-app\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a><\/p>\n<pre><code class=\"javascript\">const express = require(\"express\"); const app = express(); const port = 3000;  app.set(\"view engine\", \"ejs\");  app.use((req, res, next) =&gt; {     console.log(req.headers)     const token = req.headers.authorization;     if (!token) {         return res.status(401).send(\"Unauthorized\");     }     next() })  app.get(\"\/\", (req, res) =&gt; {     const token = req.headers.authorization;     const jwtPayload = JSON.parse(Buffer.from(token.split('.')[1], 'base64').toString());     const user = { name: jwtPayload.sub };     res.render(\"profile\", { user }); });  app.get(\"\/sensitive\", (req, res) =&gt; {     const sensitiveData = { bankAccount: \"1234-5678-9012-3456\", secretKey: \"MY_SUPER_SECRET_KEY\" };     res.render(\"sensitive\", { sensitiveData }); });  app.listen(port, () =&gt; console.log(`Server running at http:\/\/localhost:${port}`));<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u0444\u0430\u0439\u043b\u00a0<code>docker-compose.yml<\/code>\u00a0\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u00a0<code>services<\/code>\u00a0\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/p>\n<pre><code class=\"yaml\">services:   demo-app:     build: .\/demo-app     container_name: demo-app<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439\u00a0<code>docker compose up -d --build demo-app<\/code><\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0430\u0443\u0442\u0435\u043d\u0438\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 OpenAM<\/h3>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u0444\u0430\u0439\u043b\u00a0<code>docker-compose.yml<\/code>\u00a0\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u00a0<code>services<\/code>\u00a0\u0441\u0435\u0440\u0438\u0441 OpenAM:<\/p>\n<pre><code class=\"yaml\">services: ...   openam:     image: openidentityplatform\/openam:latest     container_name: openam     hostname: openam.example.org     ports:       - \"8080:8080\"<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 OpenAM \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439\u00a0<code>docker compose up openam<\/code>. \u0414\u043e\u0436\u0434\u0438\u0442\u0435\u0441\u044c \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">docker exec -w '\/usr\/openam\/ssoconfiguratortools' openam bash -c \\ 'echo \"ACCEPT_LICENSES=true SERVER_URL=http:\/\/openam.example.org:8080 DEPLOYMENT_URI=\/$OPENAM_PATH BASE_DIR=$OPENAM_DATA_DIR locale=en_US PLATFORM_LOCALE=en_US AM_ENC_KEY= ADMIN_PWD=passw0rd AMLDAPUSERPASSWD=p@passw0rd COOKIE_DOMAIN=example.org ACCEPT_LICENSES=true DATA_STORE=embedded DIRECTORY_SSL=SIMPLE DIRECTORY_SERVER=openam.example.org DIRECTORY_PORT=50389 DIRECTORY_ADMIN_PORT=4444 DIRECTORY_JMX_PORT=1689 ROOT_SUFFIX=dc=openam,dc=example,dc=org DS_DIRMGRDN=cn=Directory Manager DS_DIRMGRPASSWD=passw0rd\" &gt; conf.file &amp;&amp; java -jar openam-configurator-tool*.jar --file conf.file'<\/code><\/pre>\n<p>\u0414\u043e\u0436\u0434\u0438\u0442\u0435\u0441\u044c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 MFA \u0432 OpenAM<\/h4>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 OpenAM \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435\u00a0<a href=\"http:\/\/openam.example.org:8080\/openam\" rel=\"noopener noreferrer nofollow\">http:\/\/openam.example.org:8080\/openam<\/a>.<\/p>\n<p>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u044d\u0442\u043e\u00a0<code>amadmin<\/code>\u00a0\u0438\u00a0<code>passw0rd<\/code>\u00a0\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u0439\u0441\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Top Level Realm. \u0412 \u043c\u0435\u043d\u044e \u0441\u043b\u0435\u0432\u0430 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Authentication \u2192 Modules \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c\u00a0<code>totp<\/code>\u00a0\u0441 \u0442\u0438\u043f\u043e\u043c\u00a0<code>Authenticator (OATH)<\/code><\/p>\n<figure class=\"full-width\">\n<div><figcaption>New TOTP Module.png<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435\u00a0<strong>OATH Algorithm to Use: TOTP<\/strong>, \u0442\u0430\u043a\u0436\u0435 \u0443\u043a\u0430\u0436\u0438\u0442\u0435\u00a0<strong>Name of the Issuer<\/strong>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<strong>OpenAM<\/strong>.\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u00a0<code>totp<\/code>.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>TOTP module settings<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 Top Level Realm, \u0432 \u043c\u0435\u043d\u044e \u0441\u043b\u0435\u0432\u0430 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 Authentication \u2192 Chains \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438\u00a0<code>totp<\/code><\/p>\n<figure class=\"full-width\">\n<div><figcaption>New TOTP authentication chain<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c\u00a0<code>totp<\/code>\u00a0\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>TOTP authentication chain settings<\/figcaption><\/div>\n<\/figure>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/h4>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 OpenAM \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438\u00a0<code>\/sensitive<\/code>\u00a0\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438\u00a0<code>totp<\/code>, \u043d\u043e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 20 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 OpenAM. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 Top Level Realm. \u0412 \u043c\u0435\u043d\u044e \u0441\u043b\u0435\u0432\u0430 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Authorization \u2192 Policy Sets. \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Default Policy Set. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443\u00a0<code>demo-sensitive<\/code>.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0438\u043f\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 URL \u0438 \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u0440\u0435\u0441\u0443\u0440\u0441, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043d\u0438\u0436\u0435. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 Add \u0438 \u0437\u0430\u0442\u0435\u043c Create.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>OpenAM new policy<\/figcaption><\/div>\n<\/figure>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u043d\u0430 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0435 Resources \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435 GET \u0438 POST \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Policy Actions<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0435 Subjects \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0442\u0438\u043f \u201cAuthenticated Users\u201d.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Policy Subjects<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0435 Environments \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 Authentication by Module Chain \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0443\u00a0<code>totp<\/code>.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Policy Environments<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0430\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435\u00a0<code>totp<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e 20 \u0441\u0435\u043a\u0443\u043d\u0434. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0432 OpenAM \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043d\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438. \u041d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c OpenAM \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0438\u0437 \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u0412 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043c\u0435\u043d\u044e \u0432 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 Configure \u2192 Global Services. \u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u0435 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0443\u043d\u043a\u0442 Scripting. \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0443 Secondary Configuration.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Configure Scripting<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e\u00a0<code>POLICY_CONDITION<\/code>. \u041d\u0430 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0435 Secondary Configurations \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 EngineConfiguration.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Scripting Policy Condition<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u0441\u043f\u0438\u0441\u043e\u043a\u00a0<strong>Java class whitelist<\/strong>\u00a0\u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435\u00a0<code>java.time.*<\/code>\u00a0\u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c Groovy \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0438 \u0434\u0430\u0442\u043e\u0439.<\/p>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u0412 \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u043c\u0435\u043d\u044e \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Realms \u2192 Top Level Realm \u0438 \u0432 \u043c\u0435\u043d\u044e \u0441\u043b\u0435\u0432\u0430 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0443\u043d\u043a\u0442 Scripts. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 Auth Time Policy Condition.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>New Script<\/figcaption><\/div>\n<\/figure>\n<p>\u0422\u0438\u043f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 &#8212; POLICY_CONDITION. \u042f\u0437\u044b\u043a &#8212; Groovy.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Auth Time Policy Condition<\/figcaption><\/div>\n<\/figure>\n<pre><code class=\"java\">import java.time.Instant; import java.time.temporal.ChronoUnit;  logger.warning(\"Session: \" + session)  def authInstant = session.getProperty(\"authInstant\")  logger.warning(\"Auth time expired at1: \" + authInstant)  def instant = Instant.parse(authInstant) def expired = instant.plus(20, ChronoUnit.SECONDS) if (Instant.now().compareTo(expired) &gt; 0) {   logger.warning(\"Auth time expired at: \" + expired)      authorized = false } else {   authorized = true                 }<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u0412 \u043c\u0435\u043d\u044e \u0441\u043b\u0435\u0432\u0430 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 Authorization \u2192 Policy Sets \u2192 Default Policy Set \u2192 demo-sensitive.<\/p>\n<p>\u041d\u0430 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0435 Environments \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0441 \u0442\u0438\u043f\u043e\u043c Script \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c Auth Time Policy Condition.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Policy Script<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 MFA \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u00a0<code>demo<\/code>. \u042d\u0442\u0430 \u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 OpenAM.<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f OpenAM<\/h4>\n<p>\u0412\u044b\u0439\u0434\u0438\u0442\u0435 \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u0438\u043b\u0438 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u201c\u0418\u043d\u043a\u043e\u0433\u043d\u0438\u0442\u043e\u201d \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435\u00a0<a href=\"http:\/\/openam.example.org:8080\/openam\/XUI\/#login\" rel=\"noopener noreferrer nofollow\">http:\/\/openam.example.org:8080\/openam\/XUI\/#login<\/a><\/p>\n<p>\u0412 \u043f\u043e\u043b\u0435 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0432\u0432\u0435\u0434\u0438\u0442\u0435\u00a0<code>demo<\/code>\u00a0\u0438\u00a0<code>changeit<\/code>\u00a0\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u041e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0447\u043d\u0438\u0442\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435\u00a0<code>totp<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0443\u00a0<a href=\"http:\/\/openam.example.org:8080\/openam\/XUI\/#login\/&amp;service=totp&amp;ForceAuth=true\" rel=\"noopener noreferrer nofollow\">http:\/\/openam.example.org:8080\/openam\/XUI\/#login\/&amp;service=totp&amp;ForceAuth=true<\/a><\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043e\u043a\u043d\u043e \u0441 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e<\/p>\n<figure class=\"full-width\">\n<div><figcaption>OpenAM Register Device<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443\u00a0<strong>Register Device<\/strong>\u00a0\u0434\u043b\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441 QR \u043a\u043e\u0434\u043e\u043c.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>OpenAM QR Code<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 \u0438 \u043e\u0442\u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0439\u0442\u0435 \u0432 \u043d\u0435\u043c \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0439 QR \u043a\u043e\u0434. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 Login Using Verification Code.<\/p>\n<p>\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u0434 \u0438\u0437 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 Submit.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>OpenAM verification code<\/figcaption><\/div>\n<\/figure>\n<p><code>MFA<\/code>\u00a0\u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u00a0<code>demo<\/code>\u00a0\u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0442\u043e\u043a\u0435\u043d\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 JWT<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, OpenAM \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u044e \u0438 \u043f\u0438\u0448\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u0435\u0441\u0441\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0432 cookie \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440. \u041c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c OpenAM, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 OpenIG, \u043c\u043e\u0433\u043b\u0438 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0430 JWT \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c.<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-458696","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/458696","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=458696"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/458696\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=458696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=458696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=458696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}