From 27bbc59de9bf2e4c36b0ae3c4cdf688a98584925 Mon Sep 17 00:00:00 2001 From: Oliver Wolff <23139298+cuioss@users.noreply.github.com> Date: Fri, 24 Jan 2025 16:11:13 +0100 Subject: [PATCH] Adapted unit-tests --- .../authentication/portal-authentication-token/README.adoc | 2 ++ .../cuioss/portal/authentication/token/TokenKeycloakIT.java | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/authentication/portal-authentication-token/README.adoc b/modules/authentication/portal-authentication-token/README.adoc index 13d40249..d63d69d2 100644 --- a/modules/authentication/portal-authentication-token/README.adoc +++ b/modules/authentication/portal-authentication-token/README.adoc @@ -19,6 +19,8 @@ The core functionality is the simplified configuration of checking the signature The central objects are: +* link:src/main/java/de/cuioss/portal/authentication/token/TokenFactory.java[TokenFactory] + * link:src/main/java/de/cuioss/portal/authentication/token/JwksAwareTokenParser.java[Configuration of the io.smallrye.jwt.auth.principal.JWTParser] * link:src/main/java/de/cuioss/portal/authentication/token/ParsedAccessToken.java[ParsedAccessToken] diff --git a/modules/authentication/portal-authentication-token/src/test/java/de/cuioss/portal/authentication/token/TokenKeycloakIT.java b/modules/authentication/portal-authentication-token/src/test/java/de/cuioss/portal/authentication/token/TokenKeycloakIT.java index f4652b1c..359f4956 100644 --- a/modules/authentication/portal-authentication-token/src/test/java/de/cuioss/portal/authentication/token/TokenKeycloakIT.java +++ b/modules/authentication/portal-authentication-token/src/test/java/de/cuioss/portal/authentication/token/TokenKeycloakIT.java @@ -51,7 +51,8 @@ void shouldHandleValidKeycloakTokens() { var tokenString = requestToken(parameterForScopedToken(SCOPES), TokenTypes.ACCESS); var parser = JwksAwareTokenParser.builder().jwksEndpoint(getJWKSUrl()).jwksRefreshIntervall(100).jwksIssuer(getIssuer()).tTlsCertificatePath(TestRealm.providedKeyStore.PUBLIC_CERT).build(); - var retrievedAccessToken = ParsedAccessToken.fromTokenString(tokenString, parser); + var factory = TokenFactory.of(parser); + var retrievedAccessToken = factory.createAccessToken(tokenString); assertTrue(retrievedAccessToken.isPresent()); var accessToken = retrievedAccessToken.get(); @@ -62,7 +63,7 @@ void shouldHandleValidKeycloakTokens() { tokenString = requestToken(parameterForScopedToken(SCOPES), TokenTypes.ID_TOKEN); - var idToken = ParsedIdToken.fromTokenString(tokenString, parser); + var idToken = factory.createIdToken(tokenString); assertFalse(idToken.isEmpty()); assertFalse(idToken.get().isExpired());