Skip to content

Commit

Permalink
Adapted unit-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cuioss committed Jan 24, 2025
1 parent fa3ca9a commit 27bbc59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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());
Expand Down

0 comments on commit 27bbc59

Please sign in to comment.