Skip to content

Commit

Permalink
improve OAuth2UserServiceMultiTenantTest
Browse files Browse the repository at this point in the history
expiresAt must be after issuedAt
  • Loading branch information
bseber committed Jan 19, 2024
1 parent 1addae8 commit 76370a1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void ensureOriginalOidcUserWhenUserDoesNotExistYet() {
final Map<String, Object> claims = Map.of(SUB, "uuid");

final ClientRegistration clientRegistration = ClientRegistration.withRegistrationId("most-awesome-tenant").authorizationGrantType(JWT_BEARER).build();
final OAuth2AccessToken accessToken = new OAuth2AccessToken(BEARER, "token-value", Instant.now(), Instant.now());
final OAuth2AccessToken accessToken = new OAuth2AccessToken(BEARER, "token-value", Instant.now(), Instant.now().plusNanos(1));
final OidcIdToken oidcToken = OidcIdToken.withTokenValue("token-value").claims(map -> map.putAll(claims)).build();
final OidcUserRequest oidcUserRequest = new OidcUserRequest(clientRegistration, accessToken, oidcToken);

Expand All @@ -76,7 +76,7 @@ void ensureMergedRemoteAndApplicationAuthorities() {
final Map<String, Object> claims = Map.of(SUB, "uuid");

final ClientRegistration clientRegistration = ClientRegistration.withRegistrationId("most-awesome-tenant").authorizationGrantType(JWT_BEARER).build();
final OAuth2AccessToken accessToken = new OAuth2AccessToken(BEARER, "token-value", Instant.now(), Instant.now());
final OAuth2AccessToken accessToken = new OAuth2AccessToken(BEARER, "token-value", Instant.now(), Instant.now().plusNanos(1));
final OidcIdToken oidcToken = OidcIdToken.withTokenValue("token-value").claims(map -> map.putAll(claims)).build();
final OidcUserRequest oidcUserRequest = new OidcUserRequest(clientRegistration, accessToken, oidcToken);

Expand All @@ -97,7 +97,7 @@ void ensureSecurityContextIsSet() {
final Map<String, Object> claims = Map.of(SUB, "uuid");

final ClientRegistration clientRegistration = ClientRegistration.withRegistrationId("most-awesome-tenant").authorizationGrantType(JWT_BEARER).build();
final OAuth2AccessToken accessToken = new OAuth2AccessToken(BEARER, "token-value", Instant.now(), Instant.now());
final OAuth2AccessToken accessToken = new OAuth2AccessToken(BEARER, "token-value", Instant.now(), Instant.now().plusNanos(1));
final OidcIdToken oidcToken = OidcIdToken.withTokenValue("token-value").claims(map -> map.putAll(claims)).build();
final OidcUserRequest oidcUserRequest = new OidcUserRequest(clientRegistration, accessToken, oidcToken);

Expand Down

0 comments on commit 76370a1

Please sign in to comment.