Skip to content

Commit

Permalink
Save AT/RT lifetime from client registration req
Browse files Browse the repository at this point in the history
  • Loading branch information
federicaagostini committed Sep 11, 2023
1 parent 27597ec commit 5d77475
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,16 @@ public ClientDetailsEntity entityFromRegistrationRequest(RegisteredClientDTO dto

client.setLogoUri(dto.getLogoUri());
client.setPolicyUri(dto.getPolicyUri());

client.setRedirectUris(cloneSet(dto.getRedirectUris()));

client.setScope(cloneSet(dto.getScope()));
client.setGrantTypes(new HashSet<>());

client.setGrantTypes(new HashSet<>());

if (!isNull(dto.getGrantTypes())) {
client.setGrantTypes(
dto.getGrantTypes()
.stream()
.map(AuthorizationGrantType::getGrantType)
.collect(toSet()));
dto.getGrantTypes().stream().map(AuthorizationGrantType::getGrantType).collect(toSet()));
}

if (dto.getScope().contains("offline_access")) {
Expand All @@ -231,6 +228,14 @@ public ClientDetailsEntity entityFromRegistrationRequest(RegisteredClientDTO dto
client.setCodeChallengeMethod(pkceAlgo);
}

if (dto.getAccessTokenValiditySeconds() != null) {
client.setAccessTokenValiditySeconds(dto.getAccessTokenValiditySeconds());
}

if (dto.getRefreshTokenValiditySeconds() != null) {
client.setRefreshTokenValiditySeconds(dto.getRefreshTokenValiditySeconds());
}

return client;
}

Expand Down

0 comments on commit 5d77475

Please sign in to comment.