Skip to content

Commit

Permalink
Removed default settings for AT
Browse files Browse the repository at this point in the history
Conflicts with RAT logic
  • Loading branch information
enricovianello committed Nov 30, 2023
1 parent e27cd75 commit 6b8dcf7
Showing 1 changed file with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ public class DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityServi
private static final Logger logger =
LoggerFactory.getLogger(DefaultOAuth2ProviderTokenService.class);

private static final int DEFAULT_ACCESS_TOKEN_VALIDITY_SECS = 3600;

@Autowired
private OAuth2TokenRepository tokenRepository;

Expand All @@ -105,16 +103,6 @@ public class DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityServi
@Autowired
private ApprovedSiteService approvedSiteService;

int defaultAccessTokenValiditySeconds;

public DefaultOAuth2ProviderTokenService() {
this(DEFAULT_ACCESS_TOKEN_VALIDITY_SECS);
}

public DefaultOAuth2ProviderTokenService(int defaultAccessTokenValiditySeconds) {
this.defaultAccessTokenValiditySeconds = defaultAccessTokenValiditySeconds;
}

@Override
public Set<OAuth2AccessTokenEntity> getAllAccessTokensForUser(String userName) {
return tokenRepository.getAccessTokensByUserName(userName);
Expand Down Expand Up @@ -239,9 +227,6 @@ public OAuth2AccessTokenEntity createAccessToken(OAuth2Authentication authentica
new Date(System.currentTimeMillis() + (client.getAccessTokenValiditySeconds() * 1000L));

token.setExpiration(expiration);
} else {
token.setExpiration(
new Date(System.currentTimeMillis() + (defaultAccessTokenValiditySeconds * 1000L)));
}

// attach the authorization so that we can look it up later
Expand Down Expand Up @@ -405,9 +390,6 @@ public OAuth2AccessTokenEntity refreshAccessToken(String refreshTokenValue,
Date expiration =
new Date(System.currentTimeMillis() + (client.getAccessTokenValiditySeconds() * 1000L));
token.setExpiration(expiration);
} else {
token.setExpiration(
new Date(System.currentTimeMillis() + (defaultAccessTokenValiditySeconds * 1000L)));
}

if (client.isReuseRefreshToken()) {
Expand Down

0 comments on commit 6b8dcf7

Please sign in to comment.