Skip to content

Commit 05bec49

Browse files
committed
Merge branch 'feature/dev_oauth2_client' into 2.8
2 parents e8d5986 + 76e1d7a commit 05bec49

File tree

7 files changed

+41
-734
lines changed

7 files changed

+41
-734
lines changed

docker/dev/common/oauth2/keycloak/Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ RUN microdnf update -y && microdnf install -y jq && microdnf clean all
66

77
ADD oauth2/keycloak/setup.sh /setup.sh
88
ADD functions.sh /functions.sh
9+
10+
ENTRYPOINT []
11+
CMD ["/sbin/init"]

docker/dev/common/oauth2/keycloak/setup.sh

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ KCADM=${BINDIR}/kcadm.sh
6363
REALM=${KEYCLOAK_REALM}
6464
ADMIN_REALM=${KEYCLOAK_ADMIN_REALM}
6565

66+
/opt/jboss/tools/docker-entrypoint.sh -b 0.0.0.0 &
67+
6668
wait_for_keycloak_to_become_ready ${MY_KEYCLOAK_SERVER}
6769

6870
### login

docker/dev/common/oauth2/keycloak/standalone-ha.xml

-693
This file was deleted.

docker/dev/common/oauth2/mariadb/initdb.d/001-create-tables.sql

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ CREATE TABLE IF NOT EXISTS `issues` (
3434
`date` timestamp NULL,
3535
`ip_addr` varchar(256) DEFAULT NULL,
3636
`hostname` varchar(256) DEFAULT NULL,
37+
`type` int DEFAULT '0',
3738
PRIMARY KEY (`id`),
3839
KEY `id` (`id`)
3940
);
41+

docker/dev/common/oauth2/tomcat/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
FROM maven:3.6.3-jdk-11-slim as BUILD
1+
FROM jelastic/maven:3.9.5-openjdk-21 as BUILD
22
WORKDIR /build
33
COPY jwt-server/pom.xml /build
44
COPY jwt-server/src /build/src
55
COPY docker/dev/common/oauth2/tomcat/application.properties /build/src/main/resources
66
ARG MAVEN_OPTS
77
RUN mvn package
88

9-
FROM tomcat:9.0.71-jdk11
9+
FROM tomcat:10.1.30-jdk21
1010
ADD docker/dev/common/oauth2/tomcat/conf/server.xml /usr/local/tomcat/conf/server.xml
1111
COPY --from=0 /build/target/jwt-server.war /usr/local/tomcat/
1212

docker/dev/common/oauth2/tomcat/application.properties

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
server.port=9000
2-
31
# change keycloak settings
4-
keycloak.enabled=true
5-
keycloak.auth-server-url=https://jwt-keycloak:8443/auth
6-
keycloak.realm=hpci
7-
keycloak.resource=hpci-jwt-server
8-
keycloak.public-client=false
9-
keycloak.credentials.secret=${GFDOCKER_SASL_HPCI_SECET:K0WSOlQTizF7hJ7xOvGRDsD57ME0Vdxz}
2+
spring.security.oauth2.client.registration.keycloak.client-id=hpci-jwt-server
3+
spring.security.oauth2.client.registration.keycloak.client-secret=${GFDOCKER_SASL_HPCI_SECET:K0WSOlQTizF7hJ7xOvGRDsD57ME0Vdxz}
4+
spring.security.oauth2.client.registration.keycloak.provider=keycloak
5+
spring.security.oauth2.client.registration.keycloak.scope=openid
6+
spring.security.oauth2.client.registration.keycloak.authorization-grant-type=authorization_code
7+
spring.security.oauth2.client.provider.keycloak.issuer-uri=https://jwt-keycloak:8443/auth/realms/hpci
8+
#spring.security.oauth2.client.provider.keycloak.issuer-uri=http://jwt-keycloak:8080/auth/realms/hpci
9+
1010
user-claim=hpci.id
1111

1212
jwt-server.passphrase=${GFDOCKER_SASL_PASSPHRASE:gdmyzb3n6bevxjikfo99y5piegtxmwi7}

docker/dev/common/oauth2/tomcat/conf/server.xml

+24-31
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
<!-- Security listener. Documentation at /docs/config/listeners.html
2525
<Listener className="org.apache.catalina.security.SecurityListener" />
2626
-->
27-
<!-- APR library loader. Documentation at /docs/apr.html -->
28-
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
27+
<!-- OpenSSL support using Tomcat Native -->
28+
<Listener className="org.apache.catalina.core.AprLifecycleListener" />
29+
<!-- OpenSSL support using FFM API from Java 22 -->
30+
<!-- <Listener className="org.apache.catalina.core.OpenSSLLifecycleListener" /> -->
2931
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
3032
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
3133
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
@@ -61,22 +63,27 @@
6163

6264
<!-- A "Connector" represents an endpoint by which requests are received
6365
and responses are returned. Documentation at :
64-
Java HTTP Connector: /docs/config/http.html
65-
Java AJP Connector: /docs/config/ajp.html
66-
APR (HTTP/AJP) Connector: /docs/apr.html
66+
HTTP Connector: /docs/config/http.html
67+
AJP Connector: /docs/config/ajp.html
6768
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
6869
-->
70+
6971
<Connector port="8080" protocol="HTTP/1.1"
7072
connectionTimeout="20000"
71-
redirectPort="8443" />
73+
redirectPort="8443"
74+
maxParameterCount="1000"
75+
/>
76+
7277
<!-- A "Connector" using the shared thread pool-->
7378
<!--
7479
<Connector executor="tomcatThreadPool"
7580
port="8080" protocol="HTTP/1.1"
7681
connectionTimeout="20000"
77-
redirectPort="8443" />
82+
redirectPort="8443"
83+
maxParameterCount="1000"
84+
/>
7885
-->
79-
<!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443
86+
<!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
8087
This connector uses the NIO implementation. The default
8188
SSLImplementation will depend on the presence of the APR/native
8289
library and the useOpenSSL attribute of the AprLifecycleListener.
@@ -85,39 +92,25 @@
8592
-->
8693
<!--
8794
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
88-
maxThreads="150" SSLEnabled="true">
89-
<SSLHostConfig>
90-
<Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
91-
type="RSA" />
92-
</SSLHostConfig>
93-
</Connector>
94-
-->
95-
<!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
96-
This connector uses the APR/native implementation which always uses
97-
OpenSSL for TLS.
98-
Either JSSE or OpenSSL style configuration may be used. OpenSSL style
99-
configuration is used below.
100-
-->
101-
<!--
102-
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
103-
maxThreads="150" SSLEnabled="true" >
95+
maxThreads="150" SSLEnabled="true"
96+
maxParameterCount="1000"
97+
>
10498
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
10599
<SSLHostConfig>
106-
<Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
107-
certificateFile="conf/localhost-rsa-cert.pem"
108-
certificateChainFile="conf/localhost-rsa-chain.pem"
109-
type="RSA" />
100+
<Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
101+
certificateKeystorePassword="changeit" type="RSA" />
110102
</SSLHostConfig>
111103
</Connector>
112104
-->
113105

114106
<!-- Define an AJP 1.3 Connector on port 8009 -->
115-
116107
<Connector protocol="AJP/1.3"
117108
address="0.0.0.0"
118109
port="8009"
119-
secretRequired="false"
120-
redirectPort="8443" />
110+
enableLookups="true"
111+
redirectPort="8443"
112+
secretRequired="false"
113+
/>
121114

122115
<!-- An Engine represents the entry point (within Catalina) that processes
123116
every request. The Engine implementation for Tomcat stand alone

0 commit comments

Comments
 (0)