Merge pull request #96 from dBucik/deps

Deps
pull/1580/head
Dominik František Bučík 2021-12-06 13:57:47 +01:00 committed by GitHub
commit 698777f159
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 61 additions and 39 deletions

View File

@ -128,8 +128,12 @@
<artifactId>jaxb-runtime</artifactId>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<groupId>org.glassfish</groupId>
<artifactId>javax.servlet</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.directory.api</groupId>
@ -139,6 +143,10 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
@ -147,6 +155,10 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -1,7 +1,8 @@
package cz.muni.ics.mdc;
import java.io.IOException;
import javax.servlet.FilterChain;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
@ -18,12 +19,12 @@ public class MultiMDCFilter extends GenericFilterBean {
public MultiMDCFilter() {
this.remoteAddressMDCFilter = new RemoteAddressMDCFilter();
this.sessionIdMDCFilter = new SessionIdMDCFilter();
log.info("--- Initialized MultiMDCFilter ---");
log.info("--- Initialized MultiMDCFilter ---");
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
throws IOException, ServletException
throws ServletException, IOException
{
remoteAddressMDCFilter.doFilter(servletRequest);
sessionIdMDCFilter.doFilter(servletRequest);

View File

@ -3,6 +3,7 @@ package cz.muni.ics.oidc.server;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.nimbusds.jose.shaded.json.JSONArray;
import com.nimbusds.jose.util.JSONObjectUtils;
import com.nimbusds.jwt.JWTClaimsSet;
import cz.muni.ics.oauth2.model.ClientDetailsEntity;
@ -15,7 +16,6 @@ import java.text.ParseException;
import java.util.Map;
import java.util.Set;
import lombok.extern.slf4j.Slf4j;
import net.minidev.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.provider.OAuth2Request;

View File

@ -25,6 +25,7 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.nimbusds.jose.Algorithm;
import com.nimbusds.jose.JOSEObjectType;
import com.nimbusds.jose.JWEHeader;
import com.nimbusds.jose.JWEObject;
import com.nimbusds.jose.JWSAlgorithm;
@ -59,7 +60,6 @@ import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.security.oauth2.provider.OAuth2Request;
import org.springframework.stereotype.Service;
/**
* Default implementation of service to create specialty OpenID Connect tokens.
*
@ -140,7 +140,7 @@ public class DefaultOIDCTokenService implements OIDCTokenService {
if (responseTypes.contains("token")) {
// calculate the token hash
Base64URL at_hash = IdTokenHashUtils.getAccessTokenHash(signingAlg, accessToken);
idClaims.claim("at_hash", at_hash);
idClaims.claim("at_hash", at_hash.toString());
}
addCustomIdTokenClaims(idClaims, client, request, sub, accessToken);
@ -166,7 +166,6 @@ public class DefaultOIDCTokenService implements OIDCTokenService {
if (signingAlg.equals(Algorithm.NONE)) {
// unsigned ID token
idToken = new PlainJWT(idClaims.build());
} else {
// signed ID token
@ -175,7 +174,7 @@ public class DefaultOIDCTokenService implements OIDCTokenService {
|| signingAlg.equals(JWSAlgorithm.HS384)
|| signingAlg.equals(JWSAlgorithm.HS512)) {
JWSHeader header = new JWSHeader(signingAlg, null, null, null, null, null, null, null, null, null,
JWSHeader header = new JWSHeader(signingAlg, JOSEObjectType.JWT, null, null, null, null, null, null, null, null,
jwtService.getDefaultSignerKeyId(),
null, null);
idToken = new SignedJWT(header, idClaims.build());
@ -187,7 +186,7 @@ public class DefaultOIDCTokenService implements OIDCTokenService {
} else {
idClaims.claim("kid", jwtService.getDefaultSignerKeyId());
JWSHeader header = new JWSHeader(signingAlg, null, null, null, null, null, null, null, null, null,
JWSHeader header = new JWSHeader(signingAlg, JOSEObjectType.JWT, null, null, null, null, null, null, null, null,
jwtService.getDefaultSignerKeyId(),
null, null);

View File

@ -568,7 +568,7 @@ public class ClientAPI {
newClient.setJwksUri(claimSet.getStringClaim(claim));
break;
case JWKS:
newClient.setJwks(JWKSet.parse(claimSet.getJSONObjectClaim(claim).toJSONString()));
newClient.setJwks(JWKSet.parse(claimSet.getJSONObjectClaim(claim)));
break;
case POLICY_URI:
newClient.setPolicyUri(claimSet.getStringClaim(claim));

View File

@ -681,7 +681,7 @@ public class DynamicClientRegistrationEndpoint {
newClient.setJwksUri(claimSet.getStringClaim(claim));
break;
case JWKS:
newClient.setJwks(JWKSet.parse(claimSet.getJSONObjectClaim(claim).toJSONString()));
newClient.setJwks(JWKSet.parse(claimSet.getJSONObjectClaim(claim)));
break;
case POLICY_URI:
newClient.setPolicyUri(claimSet.getStringClaim(claim));

62
pom.xml
View File

@ -82,27 +82,28 @@
<!-- Database -->
<postgresql.version>42.3.1</postgresql.version>
<mysql.version>8.0.27</mysql.version>
<hsqldb.version>2.5.2</hsqldb.version>
<hsqldb.version>2.6.1</hsqldb.version>
<mariadb-java-client.version>2.7.4</mariadb-java-client.version>
<hikari.version>3.4.5</hikari.version>
<shedlock.version>4.3.1</shedlock.version>
<hikari.version>5.0.0</hikari.version>
<shedlock.version>4.3.1</shedlock.version><!-- CANNOT BE UPGRADED DUE TO SPRING 4 Compatibility -->
<shedlock-spring.version>${shedlock.version}</shedlock-spring.version>
<shedlock-provider-jdbc-template.version>${shedlock.version}</shedlock-provider-jdbc-template.version>
<!-- Servlet -->
<jakarta-jstl.version>1.2.6</jakarta-jstl.version>
<jakarta-servlet-api.version>4.0.4</jakarta-servlet-api.version>
<glassfish-servlet.version>3.1.1</glassfish-servlet.version>
<glassfish-jstl.version>1.2.6</glassfish-jstl.version>
<!-- Eclipse -->
<javax-persistence-api.version>2.2</javax-persistence-api.version>
<eclipse-persistence.version>2.7.9</eclipse-persistence.version>
<eclipse-persistence-core.version>${eclipse-persistence.version}</eclipse-persistence-core.version>
<eclipse-persistence-jpa.version>${eclipse-persistence.version}</eclipse-persistence-jpa.version>
<!-- LDAP -->
<apache-directory-api.version>2.1.0</apache-directory-api.version>
<apache-ldap-api-all.version>2.1.0</apache-ldap-api-all.version>
<!-- Logging -->
<logback.verison>1.2.7</logback.verison>
<logback.version>1.2.7</logback.version>
<!-- Testing -->
<junit.version>4.13.2</junit.version>
@ -112,7 +113,7 @@
<guava.version>31.0.1-jre</guava.version>
<gson.version>2.8.9</gson.version>
<httpclient.version>4.5.13</httpclient.version>
<nimbus-jose-jwt.version>8.23</nimbus-jose-jwt.version>
<nimbus-jose-jwt.version>9.15.2</nimbus-jose-jwt.version>
<javax-annotation-api.version>1.3.2</javax-annotation-api.version>
<jaxb.version>2.3.3</jaxb.version>
<aspectjweaver.version>1.9.7</aspectjweaver.version>
@ -176,16 +177,14 @@
<!-- Servlet -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${jakarta-servlet-api.version}</version>
<scope>provided</scope>
<groupId>org.glassfish</groupId>
<artifactId>javax.servlet</artifactId>
<version>${glassfish-servlet.version}</version>
</dependency>
<!-- Replace this with the 2+ version when migrated to tomcat 10+ -->
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
<version>${jakarta-jstl.version}</version>
<version>${glassfish-jstl.version}</version>
</dependency>
<!-- Database -->
@ -209,6 +208,12 @@
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>${hikari.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
@ -227,6 +232,12 @@
</dependency>
<!-- Eclipse Persistence -->
<!-- https://mvnrepository.com/artifact/javax.persistence/javax.persistence-api -->
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>${javax-persistence-api.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.core</artifactId>
@ -256,13 +267,12 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.verison}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
<!-- Other libraries -->
@ -315,7 +325,7 @@
<dependency>
<groupId>org.apache.directory.api</groupId>
<artifactId>api-all</artifactId>
<version>${apache-directory-api.version}</version>
<version>${apache-ldap-api-all.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
@ -342,6 +352,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.appfuse.plugins</groupId>
@ -366,10 +380,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>