{"id":346151,"date":"2023-03-02T15:00:26","date_gmt":"2023-03-02T15:00:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=346151"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=346151","title":{"rendered":"<span>KeyCloak \u0438 \u043c\u0438\u043a\u0440\u043e-\u0441\u0435\u0440\u0432\u0438\u0441\u044b. \u041a\u0430\u043a \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0436\u0438\u0437\u043d\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0443<\/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<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/fa8\/b3c\/571\/fa8b3c571b0104244a17e2b98da1351f.png\" alt=\"\u0421\u044b\u043d \u041c\u0430\u043c\u0438\u043d\u043e\u0439 \u041f\u043e\u0434\u0440\u0443\u0433\u0438\" title=\"\u0421\u044b\u043d \u041c\u0430\u043c\u0438\u043d\u043e\u0439 \u041f\u043e\u0434\u0440\u0443\u0433\u0438\" width=\"1080\" height=\"720\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fa8\/b3c\/571\/fa8b3c571b0104244a17e2b98da1351f.png\"\/><figcaption>\u0421\u044b\u043d \u041c\u0430\u043c\u0438\u043d\u043e\u0439 \u041f\u043e\u0434\u0440\u0443\u0433\u0438<\/figcaption><\/figure>\n<h3>\u0425\u043e\u0447\u0435\u0448\u044c \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0436\u0438\u0437\u043d\u044c \u0438 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f?<\/h3>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u0415\u0441\u043b\u0438 \u0442\u044b \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>keycloak<\/strong> \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438  \u0432 \u0441\u0432\u043e\u0435\u0439 \u043c\u0438\u043a\u0440\u043e-\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435, \u0442\u043e \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0430\u043c <strong>keycloak<\/strong>, \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c Active Directory \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u041f\u0435\u0440\u0435\u0434 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u0430\u0439\u0434\u0430 \u043f\u0440\u043e\u0448\u0443 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 keycloak \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435: <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/654475\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/company\/southbridge\/blog\/654475\/<\/a><\/p>\n<\/p>\n<h2>\u0421\u0442\u0435\u043a \u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438<\/h2>\n<p>\u042f <strong>\u0414\u0436\u0430\u0432\u0438\u0441\u0442<\/strong> \u043e\u0442 \u043a\u043e\u0436\u0438 \u0434\u043e \u043a\u043e\u0441\u0442\u0435\u0439 \u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u043c\u0438\u043a\u0440\u043e-\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 Java 18 \u0438 Spring Boot. \u0421\u0431\u043e\u0440\u043d\u0438\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0443 \u043c\u0435\u043d\u044f Maven, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438. <\/p>\n<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/hub\/postgresql\/\" rel=\"noopener noreferrer nofollow\">PostGreSql <\/a>&#8212; \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>PgAdmin &#8212; GUI  \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 \u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438  &#8212; <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/654475\/\" rel=\"noopener noreferrer nofollow\">KeyCloak<\/a> V19<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/540400\/\" rel=\"noopener noreferrer nofollow\">Zipkin + Sleuth<\/a> &#8212; \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 <\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/496182\/\" rel=\"noopener noreferrer nofollow\">Kafka<\/a> &#8212; \u0411\u0440\u043e\u043a\u0435\u0440 \u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 <\/p>\n<\/li>\n<li>\n<p>Eureka Server &#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u043c\u0438\u043a\u0440\u043e-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b\u0439 docker-compose \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"yaml\">services:   postgres:     container_name: postgres-gilgamesh     image: postgres     environment:       POSTGRES_USER: \"\u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0448 username\"       POSTGRES_PASSWORD: \"\u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0448 password\"       POSTGRES_HOST_AUTH_METHOD: trust       POSTGRES_DB: keycloak_db     volumes:       - postgres:\/data\/postgres     ports:       - \"5432:5432\"     networks:       - postgres     restart: unless-stopped   keycloak:     image: quay.io\/keycloak\/keycloak:legacy     platform: linux\/arm64     environment:       DB_VENDOR: POSTGRES       DB_ADDR: postgres       DB_SCHEMA: public       DB_DATABASE: keycloak_db       DB_USER: \"\u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0448 username \u043e\u0442 \u0411\u0414\"       DB_PASSWORD: \"\u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0448 password \u043e\u0442 \u0411\u0414\"       KEYCLOAK_USER: \"\u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0448 username\"       KEYCLOAK_HOSTNAME: localhost       KEYCLOAK_PASSWORD: \"\u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0448 \u043f\u0430\u0440\u043e\u043b\u044c\"     ports:       - 8082:8080     depends_on:       - postgres     networks:       - postgres    #\u041e\u0431\u0440\u0430\u0437 \u0413\u043e\u0442\u043e\u0432\u043e\u0433\u043e LDAP \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430   ldap:     image: rroemhild\/test-openldap     ports:       - 10389:10389       - 10636:10636     networks:       - postgres     pgadmin:     container_name: pgadmin-gilgamesh     image: dpage\/pgadmin4     environment:       PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}       PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}       PGADMIN_CONFIG_SERVER_MODE: 'False'     volumes:       - pgadmin:\/var\/lib\/pgadmin     ports:       - \"5050:80\"     networks:       - postgres     restart: unless-stopped    zipkin:     image: openzipkin\/zipkin     container_name: zipkin-gilgamesh     ports:       - \"9411:9411\"     networks:       - spring     zookeeper:     image: confluentinc\/cp-zookeeper:latest     environment:       ZOOKEEPER_CLIENT_PORT: 2181       ZOOKEEPER_TICK_TIME: 2000     ports:       - 22181:2181    kafka:     image: confluentinc\/cp-kafka:latest     depends_on:       - zookeeper     ports:       - 29092:29092     environment:       KAFKA_BROKER_ID: 1       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181       KAFKA_ADVERTISED_LISTENERS: PLAINTEXT:\/\/kafka:9092,PLAINTEXT_HOST:\/\/localhost:29092       KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT       KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1  networks:   postgres:     driver: bridge   spring:     driver: bridge volumes:   postgres:   pgadmin:<\/code><\/pre>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e parent pom.xml<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u0432\u0441\u0435 \u043c\u0438\u043a\u0440\u043e-\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c maven&#8217;a \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u044c parent \u0444\u0430\u0439\u043b, \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437. <\/p>\n<p>\u0412 \u043c\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0438\u0445 \u0443\u043a\u0430\u0436\u0435\u043c \u0432 \u043d\u0430\u0448\u0435\u043c parent pom.xml \u0444\u0430\u0439\u043b\u0435:<\/p>\n<pre><code class=\"xml\">&lt;modules>         &lt;module>eureka-server&lt;\/module>         &lt;module>incidents&lt;\/module>         &lt;module>apigw&lt;\/module>         &lt;module>clients&lt;\/module>         &lt;module>kafka&lt;\/module>         &lt;module>authentication&lt;\/module> &lt;\/modules><\/code><\/pre>\n<p>\u0423 \u0432\u0430\u0441 \u044d\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043c\u043e\u0438\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u0432\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/343550\/\" rel=\"noopener noreferrer nofollow\">\u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0443 \u043c\u0430\u0432\u0435\u043d\u0430 \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0435\u043a\u0446\u0438\u044f dependencyManagement \u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f.<\/a> <\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f dependencyManagement \u0432 maven \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u043c, \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0435\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u0432. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">&lt;dependencyManagement>         &lt;dependencies>             &lt;dependency>                 &lt;groupId>org.springframework.cloud&lt;\/groupId>                 &lt;artifactId>spring-cloud-dependencies&lt;\/artifactId>                 &lt;version>2.6.7&lt;\/version>                 &lt;type>pom&lt;\/type>                 &lt;scope>import&lt;\/scope>             &lt;\/dependency>             &lt;dependency>                 &lt;groupId>org.springframework.boot&lt;\/groupId>                 &lt;artifactId>spring-boot-dependencies&lt;\/artifactId>                 &lt;version>2.6.7&lt;\/version>                 &lt;scope>import&lt;\/scope>                 &lt;type>pom&lt;\/type>             &lt;\/dependency>             &lt;dependency>                 &lt;groupId>org.keycloak.bom&lt;\/groupId>                 &lt;artifactId>keycloak-adapter-bom&lt;\/artifactId>                 &lt;version>20.0.3&lt;\/version>                 &lt;type>pom&lt;\/type>                 &lt;scope>import&lt;\/scope>             &lt;\/dependency>         &lt;\/dependencies>     &lt;\/dependencyManagement><\/code><\/pre>\n<h2>&#171;\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e&#187; \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432 \u0434\u043e\u043a\u0435\u0440<\/h2>\n<p>\u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0432 \u0434\u043e\u043a\u0435\u0440 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043c\u043e\u0439 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 JIB. <\/p>\n<p><em>Jib \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b Docker \u0438 OCI \u0434\u043b\u044f \u0432\u0430\u0448\u0438\u0445 Java-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0435\u043c\u043e\u043d\u0430 Docker &#8212; \u0438 \u0431\u0435\u0437 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0438\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u043a Docker. \u041e\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u0432\u0438\u0434\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0434\u043b\u044f Maven \u0438 Gradle, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Java.<\/em><\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0446\u0435\u043b\u0438 JIB<\/p>\n<ul>\n<li>\n<p>\u0411\u044b\u0441\u0442\u0440\u043e\u0442\u0430 &#8212; \u0411\u044b\u0441\u0442\u0440\u043e\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. Jib \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0435\u0432, \u043e\u0442\u0434\u0435\u043b\u044f\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0436\u0434\u0430\u0442\u044c, \u043f\u043e\u043a\u0430 Docker \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0432\u0441\u0435 \u0432\u0430\u0448\u0435 Java-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 &#8212; \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0441\u043b\u043e\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c &#8212; \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0435 \u043e\u0431\u0440\u0430\u0437\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 \u0442\u0435\u043c \u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043e\u0431\u0440\u0430\u0437. \u041d\u0438\u043a\u043e\u0433\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0411\u0435\u0437 \u0434\u0435\u043c\u043e\u043d\u0430 &#8212; \u0421\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043e\u0442 CLI. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0437 Docker \u0438\u0437 Maven \u0438\u043b\u0438 Gradle \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u0435\u0433\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u0440\u0435\u0435\u0441\u0442\u0440 \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u044b\u0431\u043e\u0440\u0443. \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c Docker-\u0444\u0430\u0439\u043b\u044b \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c docker build\/push.<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e JIB \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/habr.com\/ru\/post\/552494\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/post\/552494\/<\/a>. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a: <\/p>\n<pre><code class=\"xml\">&lt;build>         &lt;pluginManagement>             &lt;plugins>                 &lt;plugin>                     &lt;groupId>org.springframework.boot&lt;\/groupId>                     &lt;artifactId>spring-boot-maven-plugin&lt;\/artifactId>                     &lt;version>2.6.7&lt;\/version>                     &lt;executions>                         &lt;execution>                             &lt;goals>                                 &lt;goal>repackage&lt;\/goal>                             &lt;\/goals>                         &lt;\/execution>                     &lt;\/executions>                 &lt;\/plugin>                 &lt;plugin>                     &lt;groupId>com.google.cloud.tools&lt;\/groupId>                     &lt;artifactId>jib-maven-plugin&lt;\/artifactId>                     &lt;version>3.3.0&lt;\/version>                     &lt;configuration>                         &lt;from>                             &lt;image>eclipse-temurin:17&lt;\/image>                             &lt;platforms>                                 &lt;platform>                                     &lt;architecture>arm64&lt;\/architecture>                                     &lt;os>linux&lt;\/os>                                 &lt;\/platform>                                 &lt;platform>                                     &lt;architecture>amd64&lt;\/architecture>                                     &lt;os>linux&lt;\/os>                                 &lt;\/platform>                             &lt;\/platforms>                         &lt;\/from>                         &lt;to>                             &lt;tags>                                 &lt;tag>latest&lt;\/tag>                             &lt;\/tags>                         &lt;\/to>                     &lt;\/configuration>                     &lt;executions>                         &lt;execution>                             &lt;phase>package&lt;\/phase>                             &lt;goals>                                 &lt;goal>                                     build                                 &lt;\/goal>                             &lt;\/goals>                         &lt;\/execution>                     &lt;\/executions>                 &lt;\/plugin>             &lt;\/plugins>         &lt;\/pluginManagement>         &lt;plugins>             &lt;plugin>                 &lt;groupId>org.apache.maven.plugins&lt;\/groupId>                 &lt;artifactId>maven-compiler-plugin&lt;\/artifactId>                 &lt;version>3.8.1&lt;\/version>                 &lt;configuration>                     &lt;source>17&lt;\/source>                     &lt;target>17&lt;\/target>                 &lt;\/configuration>             &lt;\/plugin>         &lt;\/plugins>     &lt;\/build><\/code><\/pre>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h2>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <strong>Incident <\/strong>\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u043e\u0443\u0442\u043e\u0432 \u0438 \u0437\u0430\u0441\u0435\u043a\u044e\u0440\u0438\u043c \u0438\u0445 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <strong>keycloak.<\/strong><\/p>\n<p><strong>pom.xml:<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?> &lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"          xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"          xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\">     &lt;parent>         &lt;artifactId>gilgamesh_project&lt;\/artifactId>         &lt;groupId>com.project&lt;\/groupId>         &lt;version>1.0-SNAPSHOT&lt;\/version>     &lt;\/parent>     &lt;modelVersion>4.0.0&lt;\/modelVersion>     &lt;packaging>jar&lt;\/packaging>     &lt;artifactId>incidents&lt;\/artifactId>      &lt;build>         &lt;plugins>             &lt;plugin>                 &lt;groupId>org.springframework.boot&lt;\/groupId>                 &lt;artifactId>spring-boot-maven-plugin&lt;\/artifactId>             &lt;\/plugin>         &lt;\/plugins>     &lt;\/build>      &lt;profiles>         &lt;profile>             &lt;id>build-docker-image&lt;\/id>             &lt;build>                 &lt;plugins>                     &lt;plugin>                         &lt;groupId>com.google.cloud.tools&lt;\/groupId>                         &lt;artifactId>jib-maven-plugin&lt;\/artifactId>                     &lt;\/plugin>                 &lt;\/plugins>             &lt;\/build>         &lt;\/profile>     &lt;\/profiles>      &lt;dependencies>         &lt;dependency>             &lt;groupId>org.springframework.boot&lt;\/groupId>             &lt;artifactId>spring-boot-starter-web&lt;\/artifactId>         &lt;\/dependency>         &lt;dependency>             &lt;groupId>org.springframework.boot&lt;\/groupId>             &lt;artifactId>spring-boot-starter-data-jpa&lt;\/artifactId>         &lt;\/dependency>         &lt;dependency>             &lt;groupId>org.postgresql&lt;\/groupId>             &lt;artifactId>postgresql&lt;\/artifactId>             &lt;scope>runtime&lt;\/scope>         &lt;\/dependency>         &lt;dependency>             &lt;groupId>org.springframework.cloud&lt;\/groupId>             &lt;artifactId>spring-cloud-starter-netflix-eureka-client&lt;\/artifactId>         &lt;\/dependency>         &lt;dependency>             &lt;groupId>org.springframework.cloud&lt;\/groupId>             &lt;artifactId>spring-cloud-starter-sleuth&lt;\/artifactId>         &lt;\/dependency>         &lt;dependency>             &lt;groupId>org.springframework.cloud&lt;\/groupId>             &lt;artifactId>spring-cloud-sleuth-zipkin&lt;\/artifactId>         &lt;\/dependency>         &lt;dependency>             &lt;groupId>org.springframework.boot&lt;\/groupId>             &lt;artifactId>spring-boot-starter-validation&lt;\/artifactId>         &lt;\/dependency>         &lt;dependency>             &lt;groupId>org.springframework.kafka&lt;\/groupId>             &lt;artifactId>spring-kafka&lt;\/artifactId>         &lt;\/dependency>         &lt;dependency>             &lt;groupId>org.springframework.kafka&lt;\/groupId>             &lt;artifactId>spring-kafka-test&lt;\/artifactId>             &lt;scope>test&lt;\/scope>         &lt;\/dependency>         &lt;dependency>             &lt;groupId>com.project&lt;\/groupId>             &lt;artifactId>kafka&lt;\/artifactId>             &lt;version>1.0-SNAPSHOT&lt;\/version>             &lt;scope>compile&lt;\/scope>         &lt;\/dependency>         &lt;dependency>             &lt;groupId>com.auth0&lt;\/groupId>             &lt;artifactId>java-jwt&lt;\/artifactId>             &lt;version>4.0.0&lt;\/version>         &lt;\/dependency>         &lt;dependency>             &lt;groupId>org.springframework.boot&lt;\/groupId>             &lt;artifactId>spring-boot-starter-security&lt;\/artifactId>         &lt;\/dependency>         &lt;dependency>             &lt;groupId>com.google.code.gson&lt;\/groupId>             &lt;artifactId>gson&lt;\/artifactId>             &lt;version>2.9.0&lt;\/version>         &lt;\/dependency>         &lt;dependency>             &lt;groupId>org.keycloak&lt;\/groupId>             &lt;artifactId>keycloak-spring-boot-starter&lt;\/artifactId>         &lt;\/dependency>     &lt;\/dependencies>  &lt;\/project><\/code><\/pre>\n<p>application.yml \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"yaml\">server:   port: 8080 spring:   application:     name: incidents   datasource:     password: password     url: jdbc:postgresql:\/\/localhost:5432\/incident-service     username: postgres   jpa:     hibernate:       ddl-auto: update     properties:       hibernate:         dialect: org.hibernate.dialect.PostgreSQLDialect         format_sql: true     show-sql: true   zipkin:     base-url: http:\/\/localhost:9411   kafka:     bootstrap-servers: localhost:29092 eureka:   client:     service-url:       defaultZone: http:\/\/localhost:8761\/eureka     fetch-registry: true     register-with-eureka: true<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0441\u043e\u0440\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0441\u0442 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u0443\u0436\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u0431\u0440\u043e\u043a\u0435\u0440 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438. \u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440:<\/p>\n<pre><code class=\"java\">@RestController @RequestMapping(\"api\/v1\/incident\/service\") @RequiredArgsConstructor public class IncidentController {      private final IncidentService incidentService;      @PostMapping(\"\/create\")     public ResponseEntity&lt;IncidentCreateDtoResponse> create(@Valid @RequestBody IncidentDtoRequest incidentDtoRequest) {         IncidentCreateDtoResponse incidentDtoResponse = IncidentCreateMapper.incidentCreateToDto(incidentService.create(incidentDtoRequest),new ArrayList&lt;>());         return new ResponseEntity&lt;>(incidentDtoResponse, HttpStatus.OK);     } }<\/code><\/pre>\n<p>\u0417\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441, \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043a \u043d\u0435\u043c\u0443 keycloak.<\/p>\n<\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a KeyCloak<\/h2>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 url \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 keycloak \u0432 docker-compose. \u0412\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d55\/71f\/0ee\/d5571f0eed6a0fb2fc5e034f0101eb24.png\" width=\"1920\" height=\"943\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d55\/71f\/0ee\/d5571f0eed6a0fb2fc5e034f0101eb24.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u043e\u0435 \u043e\u043a\u043d\u043e, \u0442\u043e \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e, \u0432\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 keycloak. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043d\u0430 admin console \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u0443\u0439\u0442\u0435\u0441\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043f\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0432\u0432\u043e\u0434\u0438\u043b\u0438 \u0432 docker compose \u0444\u0430\u0439\u043b.<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0432\u0441\u0435 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439:<\/p>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 realm \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6ce\/0a8\/a65\/6ce0a8a65d06dfc7f8ac01c63403f9d9.png\" width=\"1920\" height=\"946\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6ce\/0a8\/a65\/6ce0a8a65d06dfc7f8ac01c63403f9d9.png\"\/><figcaption><\/figcaption><\/figure>\n<ol start=\"2\">\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 client \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e realm<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/21f\/651\/426\/21f65142602c2f2fc097dde3a9386ecb.png\" width=\"1920\" height=\"943\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/21f\/651\/426\/21f65142602c2f2fc097dde3a9386ecb.png\"\/><figcaption><\/figcaption><\/figure>\n<ol start=\"3\">\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u043d\u0430\u0432\u0435\u0441\u044c\u0442\u0435 \u043d\u0430 \u043d\u0438\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0440\u043e\u043b\u0435\u0439. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438: <\/p>\n<ol>\n<li>\n<p>username: arnur, roles: [&#171;USER&#187;]<\/p>\n<\/li>\n<li>\n<p>username: adal, roles: [&#171;USER&#187;]<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 credentials \u0432\u0430\u0448\u0435\u0433\u043e keycloak \u0432 \u0432\u0430\u0448 application.yml, \u0447\u0442\u043e\u0431\u044b \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043d\u0430\u0448\u0435 Spring Boot \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0433\u043b\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d\u044b \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"yaml\">keycloak:   auth-server-url: http:\/\/localhost:\"\u0432\u0430\u0448 \u043f\u043e\u0440\u0442\"\/auth   resource: \"\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\"   bearer-only: true   public-client: true   realm: \"\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u0430\u043b\u043c\u0430\"<\/code><\/pre>\n<ol start=\"5\">\n<li>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0430\u0448\u0435\u0433\u043e spring security. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0432\u0430\u0448\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <strong>KeycloakWebSecurityConfigurerAdapter<\/strong>. \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0435\u0441\u0441\u0438\u0438 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0449\u0438\u0442\u0443 \u043d\u0430\u0448\u0438\u0445 \u0440\u043e\u0443\u0442\u043e\u0432. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"java\">@KeycloakConfiguration @Import(KeycloakSpringBootConfigResolver.class) public class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter {     \/**      * Registers the KeycloakAuthenticationProvider with the authentication manager.      *\/     @Autowired     public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {         KeycloakAuthenticationProvider keycloakAuthenticationProvider = new KeycloakAuthenticationProvider();         keycloakAuthenticationProvider.setGrantedAuthoritiesMapper(new SimpleAuthorityMapper());         auth.authenticationProvider(keycloakAuthenticationProvider);     }      \/**      * Defines the session authentication strategy.      *\/     @Bean     @Override     protected SessionAuthenticationStrategy sessionAuthenticationStrategy() {         return new RegisterSessionAuthenticationStrategy(buildSessionRegistry());     }      @Bean     protected SessionRegistry buildSessionRegistry() {         return new SessionRegistryImpl();     }      @Override     protected void configure(HttpSecurity http) throws Exception     {         super.configure(http);         http.cors().and().csrf().disable();         http.authorizeRequests()                 .antMatchers(\"\/api\/v1\/incident\/service\/**\").hasRole(\"USER\");         http.authorizeRequests().anyRequest().permitAll();     } } <\/code><\/pre>\n<p>\u041f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 oauth2.0 \u0442\u043e\u043a\u0435\u043d\u0430, \u0447\u0435\u0440\u0435\u0437 keycloak. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 postman \u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u0442\u043e\u043a\u0435\u043d. \u0412\u043e\u0442 \u0441\u0430\u043c\u0430\u044f \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430:<\/p>\n<ul>\n<li>\n<p>Access Token URL: <a href=\"http:\/\/localhost:8082\/auth\/realms\/gilgamesh\/protocol\/openid-connect\/token\" rel=\"noopener noreferrer nofollow\">http:\/\/&#187;\u0432\u0430\u0448 \u0443\u0440\u043b&#187;\/auth\/realms\/&#187;\u0432\u0430\u0448 \u0440\u0435\u0430\u043b\u043c&#187;\/protocol\/openid-connect\/token<\/a><\/p>\n<\/li>\n<li>\n<p>Client ID: \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>grant type: password credentials<\/p>\n<\/li>\n<li>\n<p>username: username \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/p>\n<\/li>\n<li>\n<p>password: \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/p>\n<\/li>\n<li>\n<p>scope: openid<\/p>\n<\/li>\n<\/ul>\n<h2>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 LDAP \u043a \u0432\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0443<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u044b\u0439 \u0441\u043e\u043a! KeyCloak \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u0437 AD \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 LDAP, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u043e \u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435: <a href=\"https:\/\/hub.docker.com\/r\/rroemhild\/test-openldap\/\" rel=\"noopener noreferrer nofollow\">https:\/\/hub.docker.com\/r\/rroemhild\/test-openldap\/<\/a>. \u0414\u0435\u043b\u0430\u0439\u0442\u0435 \u043f\u0443\u043b \u0438 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0439\u0442\u0435 \u0432 \u0434\u043e\u043a\u0435\u0440\u0435, \u043c\u044b \u0436\u0438\u0432\u0435\u043c \u0432 21\u043e\u043c \u0432\u0435\u043a\u0435!<\/p>\n<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c LDAP \u043a \u0432\u0430\u0448\u0435\u043c\u0443 Key\u0441loak \u0437\u0430\u0439\u0434\u0438\u0442\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b &#171;User Federation&#187; \u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 LDAP \u043a\u0430\u043a \u0432\u0430\u0448 &#171;User Provider&#187; \u0438 \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u0432\u0441\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p><strong>Console display name: <\/strong>\u043a\u0430\u043a\u043e\u0439 \u0434\u0443\u0448\u0435 \u0443\u0433\u043e\u0434\u043d\u043e<\/p>\n<\/li>\n<li>\n<p><strong>Connection URL: <\/strong>\u0442\u0443\u0442 \u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u043b\u0438 ldap \u0447\u0435\u0440\u0435\u0437 \u0434\u043e\u043a\u0435\u0440 url \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u043e\u0439: ldap:\/\/&#187;ip \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u0430&#187;:10389. \u041f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e keycloak \u043d\u0430\u043f\u0440\u043e\u0447\u044c \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0430\u0448 ldap \u0447\u0435\u0440\u0435\u0437 localhost \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u0435 \u0438\u0445 \u0432 \u043e\u0434\u0438\u043d docker-network<\/p>\n<\/li>\n<li>\n<p>Bind Type: \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 BN \u0432\u0430\u0448\u0435\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0430 <strong>\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e LDAP \u044d\u0442\u043e: cn=admin,dc=planetexpress,dc=com<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>Bind credentials: <\/strong>\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0432\u0430\u0448\u0435\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0430 <strong>\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e LDAP \u044d\u0442\u043e: GoodNewsEveryone<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>EDIT MODE<\/strong>: \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0441\u0442\u0430\u0432\u0438\u0442\u044c <strong>READ_ONLY<\/strong> <\/p>\n<\/li>\n<li>\n<p><strong>Users DN: <\/strong>\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u0449\u0443\u044e \u0438\u043d\u0444\u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u044f\u0434\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <strong>\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e LDAP \u044d\u0442\u043e: ou=people,dc=planetexpress,dc=com<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>Username LDAP attribute: <\/strong>\u0418\u043c\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 LDAP, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f Keycloak. \u0414\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 LDAP \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c &#8216;uid&#8217;. \u0414\u043b\u044f Active directory \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c &#8216;sAMAccountName&#8217; \u0438\u043b\u0438 &#8216;cn&#8217;. \u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 LDAP, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 LDAP \u0432 Keycloak. <strong>\u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e LDAP \u044d\u0442\u043e: uid<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>RDN LDAP attribute: <\/strong>\u0418\u043c\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 LDAP, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 RDN (\u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430) \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0433\u043e DN \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041e\u0431\u044b\u0447\u043d\u043e \u043e\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c Username LDAP, \u043e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f Active directory \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c &#8216;cn&#8217; \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 RDN, \u043a\u043e\u0433\u0434\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c &#8216;sAMAccountName&#8217;. <strong>\u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e LDAP \u044d\u0442\u043e: uid<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>UUID LDAP attribute: <\/strong>\u0418\u043c\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 LDAP, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 (UUID) \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 LDAP. \u0414\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 LDAP \u044d\u0442\u043e &#8216;entryUUID&#8217;; \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f Active directory \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c &#8216;objectGUID&#8217;. \u0415\u0441\u043b\u0438 \u0432\u0430\u0448 LDAP \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u0438\u0435 UUID, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u0440\u0435\u0434\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 LDAP \u0432 \u0434\u0435\u0440\u0435\u0432\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#8216;uid&#8217; \u0438\u043b\u0438 &#8216;entryDN&#8217;. <strong>\u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e LDAP \u044d\u0442\u043e: entryUUID<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>User object classes: <\/strong>\u0412\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 LDAP objectClass \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 LDAP, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: &#8216;inetOrgPerson, organizationalPerson&#8217;. \u0412\u043d\u043e\u0432\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 Keycloak \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 LDAP \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u044d\u0442\u0438\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 LDAP \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0432\u0441\u0435 \u044d\u0442\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. <strong>\u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e LDAP \u044d\u0442\u043e: inetOrgPerson, organizationalPerson, person, top<\/strong><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0436\u043c\u0438\u0442\u0435 save \u0438 \u0432 action \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 sync all users. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0435 \u044e\u0437\u0435\u0440\u044b \u0438\u0437 ldap \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u0448\u0438\u043c keycloak \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c. <\/p>\n<\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0437\u0430\u0439\u0434\u0438\u0442\u0435 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 Users \u0438 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8c3\/e5b\/cb4\/8c3e5bcb40d2ab92bbe7528b1de31ef1.png\" width=\"1631\" height=\"869\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8c3\/e5b\/cb4\/8c3e5bcb40d2ab92bbe7528b1de31ef1.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u0432\u0430\u043c\u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u0440\u043e\u043b\u044c (\u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e USER). \u0418 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432\u0441\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0442\u043e \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e, \u0432\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 KeyCloak \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<\/p>\n<h2>\u0418\u0422\u041e\u0413\u0418<\/h2>\n<p>Keycloak \u0441\u0443\u043f\u0435\u0440 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041e\u043d \u0441\u0438\u043b\u044c\u043d\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0430\u043a \u0434\u0443\u0448\u0435 \u0443\u0433\u043e\u0434\u043d\u043e. Keycloak \u0442\u0430\u043a \u0436\u0435 \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043b\u044e\u0431\u043e\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434. \u0410 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u043e\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 <strong>JAVA!<\/strong><\/p>\n<p><strong>\u0412\u0441\u0435\u043c \u0434\u043e\u0431\u0440\u0430 \u0438 \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u0430! \u041f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c Kcell \u0438 Activ!<\/strong><\/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\/post\/720070\/\"> https:\/\/habr.com\/ru\/post\/720070\/<\/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<figure class=\"full-width\"><figcaption>\u0421\u044b\u043d \u041c\u0430\u043c\u0438\u043d\u043e\u0439 \u041f\u043e\u0434\u0440\u0443\u0433\u0438<\/figcaption><\/figure>\n<h3>\u0425\u043e\u0447\u0435\u0448\u044c \u043e\u0431\u043b\u0435\u0433\u0447\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0436\u0438\u0437\u043d\u044c \u0438 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f?<\/h3>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u0415\u0441\u043b\u0438 \u0442\u044b \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>keycloak<\/strong> \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438  \u0432 \u0441\u0432\u043e\u0435\u0439 \u043c\u0438\u043a\u0440\u043e-\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435, \u0442\u043e \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0430\u043c <strong>keycloak<\/strong>, \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u0441\u0440\u0435\u0434\u0443 \u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c Active Directory \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u041f\u0435\u0440\u0435\u0434 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u0430\u0439\u0434\u0430 \u043f\u0440\u043e\u0448\u0443 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 keycloak \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435: <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/654475\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/company\/southbridge\/blog\/654475\/<\/a><\/p>\n<\/p>\n<h2>\u0421\u0442\u0435\u043a \u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438<\/h2>\n<p>\u042f <strong>\u0414\u0436\u0430\u0432\u0438\u0441\u0442<\/strong> \u043e\u0442 \u043a\u043e\u0436\u0438 \u0434\u043e \u043a\u043e\u0441\u0442\u0435\u0439 \u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u043c\u0438\u043a\u0440\u043e-\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 Java 18 \u0438 Spring Boot. \u0421\u0431\u043e\u0440\u043d\u0438\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0443 \u043c\u0435\u043d\u044f Maven, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0438. <\/p>\n<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/hub\/postgresql\/\" rel=\"noopener noreferrer nofollow\">PostGreSql <\/a>&#8212; \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>PgAdmin &#8212; GUI  \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 \u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438  &#8212; <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/654475\/\" rel=\"noopener noreferrer nofollow\">KeyCloak<\/a> V19<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/540400\/\" rel=\"noopener noreferrer nofollow\">Zipkin + Sleuth<\/a> &#8212; \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 <\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/496182\/\" rel=\"noopener noreferrer nofollow\">Kafka<\/a> &#8212; \u0411\u0440\u043e\u043a\u0435\u0440 \u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 <\/p>\n<\/li>\n<li>\n<p>Eureka Server &#8212; \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0448\u0438\u0445 \u043c\u0438\u043a\u0440\u043e-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<p>\u0413\u043e\u0442\u043e\u0432\u044b\u0439 docker-compose \u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"yaml\">services:   postgres:     container_name: postgres-gilgamesh     image: postgres     environment:       POSTGRES_USER: \"\u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0448 username\"       POSTGRES_PASSWORD: \"\u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0448 password\"       POSTGRES_HOST_AUTH_METHOD: trust       POSTGRES_DB: keycloak_db     volumes:       - postgres:\/data\/postgres     ports:       - \"5432:5432\"     networks:       - postgres     restart: unless-stopped   keycloak:     image: quay.io\/keycloak\/keycloak:legacy     platform: linux\/arm64     environment:       DB_VENDOR: POSTGRES       DB_ADDR: postgres       DB_SCHEMA: public       DB_DATABASE: keycloak_db       DB_USER: \"\u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0448 username \u043e\u0442 \u0411\u0414\"       DB_PASSWORD: \"\u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0448 password \u043e\u0442 \u0411\u0414\"       KEYCLOAK_USER: \"\u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0448 username\"       KEYCLOAK_HOSTNAME: localhost       KEYCLOAK_PASSWORD: \"\u0437\u0434\u0435\u0441\u044c \u0432\u0430\u0448 \u043f\u0430\u0440\u043e\u043b\u044c\"     ports:       - 8082:8080     depends_on:       - postgres     networks:       - postgres    #\u041e\u0431\u0440\u0430\u0437 \u0413\u043e\u0442\u043e\u0432\u043e\u0433\u043e LDAP \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430   ldap:     image: rroemhild\/test-openldap     ports:       - 10389:10389       - 10636:10636     networks:       - postgres     pgadmin:     container_name: pgadmin-gilgamesh     image: dpage\/pgadmin4     environment:       PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}       PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}       PGADMIN_CONFIG_SERVER_MODE: 'False'     volumes:       - pgadmin:\/var\/lib\/pgadmin     ports:       - \"5050:80\"     networks:       - postgres     restart: unless-stopped    zipkin:     image: openzipkin\/zipkin     container_name: zipkin-gilgamesh     ports:       - \"9411:9411\"     networks:       - spring     zookeeper:     image: confluentinc\/cp-zookeeper:latest     environment:       ZOOKEEPER_CLIENT_PORT: 2181       ZOOKEEPER_TICK_TIME: 2000     ports:       - 22181:2181    kafka:     image: confluentinc\/cp-kafka:latest     depends_on:       - zookeeper     ports:       - 29092:29092     environment:       KAFKA_BROKER_ID: 1       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181       KAFKA_ADVERTISED_LISTENERS: PLAINTEXT:\/\/kafka:9092,PLAINTEXT_HOST:\/\/localhost:29092       KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT       KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1  networks:   postgres:     driver: bridge   spring:     driver: bridge volumes:   postgres:   pgadmin:<\/code><\/pre>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e parent pom.xml<\/h2>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u0432\u0441\u0435 \u043c\u0438\u043a\u0440\u043e-\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c maven&#8217;a \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u044c parent \u0444\u0430\u0439\u043b, \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437. <\/p>\n<p>\u0412 \u043c\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0438\u0445 \u0443\u043a\u0430\u0436\u0435\u043c \u0432 \u043d\u0430\u0448\u0435\u043c parent pom.xml \u0444\u0430\u0439\u043b\u0435:<\/p>\n<pre><code class=\"xml\">&lt;modules>         &lt;module>eureka-server&lt;\/module>         &lt;module>incidents&lt;\/module>         &lt;module>apigw&lt;\/module>         &lt;module>clients&lt;\/module>         &lt;module>kafka&lt;\/module>         &lt;module>authentication&lt;\/module> &lt;\/modules><\/code><\/pre>\n<p>\u0423 \u0432\u0430\u0441 \u044d\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043c\u043e\u0438\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u0432\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/343550\/\" rel=\"noopener noreferrer nofollow\">\u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0443 \u043c\u0430\u0432\u0435\u043d\u0430 \u0435\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0435\u043a\u0446\u0438\u044f dependencyManagement \u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f.<\/a> <\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f dependencyManagement \u0432 maven \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u043c, \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0435\u0433\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u043e\u0432. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"xml\">&lt;dependencyManagement>         &lt;dependencies>             &lt;dependency>                 &lt;groupId>org.springframework.cloud&lt;\/groupId>                 &lt;artifactId>spring-cloud-dependencies&lt;\/artifactId>                 &lt;version>2.6.7&lt;\/version>                 &lt;type>pom&lt;\/type>                 &lt;scope>import&lt;\/scope>             &lt;\/dependency>             &lt;dependency>                 &lt;groupId>org.springframework.boot&lt;\/groupId>                 &lt;artifactId>spring-boot-dependencies&lt;\/artifactId>                 &lt;version>2.6.7&lt;\/version>                 &lt;scope>import&lt;\/scope>                 &lt;type>pom&lt;\/type>             &lt;\/dependency>             &lt;dependency>                 &lt;groupId>org.keycloak.bom&lt;\/groupId>                 &lt;artifactId>keycloak-adapter-bom&lt;\/artifactId>                 &lt;version>20.0.3&lt;\/version>                 &lt;type>pom&lt;\/type>                 &lt;scope>import&lt;\/scope>             &lt;\/dependency>         &lt;\/dependencies>     &lt;\/dependencyManagement><\/code><\/pre>\n<h2>&#171;\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e&#187; \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432 \u0434\u043e\u043a\u0435\u0440<\/h2>\n<p>\u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0432 \u0434\u043e\u043a\u0435\u0440 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043c\u043e\u0439 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 JIB. <\/p>\n<p><em>Jib \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b Docker \u0438 OCI \u0434\u043b\u044f \u0432\u0430\u0448\u0438\u0445 Java-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0435\u043c\u043e\u043d\u0430 Docker &#8212; \u0438 \u0431\u0435\u0437 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0433\u043e \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0438\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u043a Docker. \u041e\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u0432\u0438\u0434\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0434\u043b\u044f Maven \u0438 Gradle, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u0432\u0438\u0434\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Java.<\/em><\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0446\u0435\u043b\u0438 JIB<\/p>\n<ul>\n<li>\n<p>\u0411\u044b\u0441\u0442\u0440\u043e\u0442\u0430 &#8212; \u0411\u044b\u0441\u0442\u0440\u043e\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. Jib \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0435\u0432, \u043e\u0442\u0434\u0435\u043b\u044f\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0436\u0434\u0430\u0442\u044c, \u043f\u043e\u043a\u0430 Docker \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0432\u0441\u0435 \u0432\u0430\u0448\u0435 Java-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 &#8212; \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0441\u043b\u043e\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438\u0441\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c &#8212; \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0435 \u043e\u0431\u0440\u0430\u0437\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 \u0442\u0435\u043c \u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043e\u0431\u0440\u0430\u0437. \u041d\u0438\u043a\u043e\u0433\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0411\u0435\u0437 \u0434\u0435\u043c\u043e\u043d\u0430 &#8212; \u0421\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043e\u0442 CLI. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0437 Docker \u0438\u0437 Maven \u0438\u043b\u0438 Gradle \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u0435\u0433\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u0440\u0435\u0435\u0441\u0442\u0440 \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u044b\u0431\u043e\u0440\u0443. \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c Docker-\u0444\u0430\u0439\u043b\u044b \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c docker build\/push.<\/p>\n<\/li>\n<\/ul>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e JIB \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c: <a href=\"https:\/\/habr.com\/ru\/post\/552494\/\" rel=\"noopener noreferrer nofollow\">https:\/\/habr.com\/ru\/post\/552494\/<\/a>. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a: <\/p>\n<pre><code class=\"xml\">&lt;build>         &lt;pluginManagement>             &lt;plugins>                 &lt;plugin>                     &lt;groupId>org.springframework.boot&lt;\/groupId>                     &lt;artifactId>spring-boot-maven-plugin&lt;\/artifactId>                     &lt;version>2.6.7&lt;\/version>                     &lt;executions>                         &lt;execution>                             &lt;goals>                                 &lt;goal>repackage&lt;\/goal>                             &lt;\/goals>                         &lt;\/execution>                     &lt;\/executions>                 &lt;\/plugin>                 &lt;plugin>                     &lt;groupId>com.google.cloud.tools&lt;\/groupId>                     &lt;artifactId>jib-maven-plugin&lt;\/artifactId>                     &lt;version>3.3.0&lt;\/version>                     &lt;configuration>                         &lt;from>                             &lt;image>eclipse-temurin:17&lt;\/image>                             &lt;platforms>                                 &lt;platform>                                     &lt;architecture>arm64&lt;\/architecture>                                     &lt;os>linux&lt;\/os>                                 &lt;\/platform>                                 &lt;platform>                                     &lt;architecture>amd64&lt;\/architecture>                                     &lt;os>linux&lt;\/os>                                 &lt;\/platform>                             &lt;\/platforms>                         &lt;\/from>                         &lt;to>                             &lt;tags>                                 &lt;tag>latest&lt;\/tag>                             &lt;\/tags>                         &lt;\/to>                     &lt;\/configuration>                     &lt;executions>                         &lt;execution>                             &lt;phase>package&lt;\/phase>                             &lt;goals>                                 &lt;goal>                                     build                                 &lt;\/goal>                             &lt;\/goals>                         &lt;\/execution>                     &lt;\/executions>                 &lt;\/plugin>             &lt;\/plugins>         &lt;\/pluginManagement>         &lt;plugins>             &lt;plugin>                 &lt;groupId>org.apache.maven.plugins&lt;\/groupId>                 &lt;artifactId>maven-compiler-plugin&lt;\/artifactId>                 &lt;version>3.8.1&lt;\/version>                 &lt;configuration>                     &lt;source>17&lt;\/source>                     &lt;target>17&lt;\/target>                 &lt;\/configuration>             &lt;\/plugin>         &lt;\/plugins>     &lt;\/build><\/code><\/pre>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h2>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <strong>Incident <\/strong>\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u043e\u0443\u0442\u043e\u0432 \u0438 \u0437\u0430\u0441\u0435\u043a\u044e\u0440\u0438\u043c \u0438\u0445 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <strong>keycloak.<\/strong><\/p>\n<p><strong>pom.xml:<\/strong><\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?> &lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"          xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"          xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\">     &lt;parent>         &lt;artifactId>gilgamesh_project&lt;\/artifactId>         &lt;groupId>com.project&lt;\/groupId>         &lt;version>1.0-SNAPSHOT&lt;\/version>     &lt;\/parent>     &lt;modelVersion>4.0.0&lt;\/modelVersion>     &lt;packaging>jar&lt;\/packaging>     &lt;artifactId>incidents&lt;\/artifactId>      &lt;build>         &lt;plugins>             &lt;plugin>                 &lt;groupId>org.springframework.boot&lt;\/groupId>                 &lt;artifactId>spring-boot-maven-plugin&lt;\/artifactId>             &lt;\/plugin>         &lt;\/plugins>     &lt;\/build>      &lt;profiles>         &lt;profile>             &lt;id>build-docker-image&lt;\/id><\/code><\/pre>\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-346151","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/346151","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=346151"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/346151\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=346151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=346151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=346151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}