Always set access token exp claim

It follows RFC https://datatracker.ietf.org/doc/html/rfc9068
Bumped MitreID version 1.3.6.cnaf-20230914
pull/1611/head
Federica Agostini 2023-09-07 18:24:05 +02:00 committed by Enrico Vianello
parent 521019fed8
commit 20a9ed1a1a
5 changed files with 9 additions and 7 deletions

View File

@ -22,7 +22,7 @@
<parent>
<artifactId>openid-connect-parent</artifactId>
<groupId>org.mitre</groupId>
<version>1.3.6.cnaf-20230726</version>
<version>1.3.6.cnaf-20230914</version>
<relativePath>..</relativePath>
</parent>
<artifactId>openid-connect-client</artifactId>

View File

@ -22,7 +22,7 @@
<parent>
<artifactId>openid-connect-parent</artifactId>
<groupId>org.mitre</groupId>
<version>1.3.6.cnaf-20230726</version>
<version>1.3.6.cnaf-20230914</version>
<relativePath>..</relativePath>
</parent>
<artifactId>openid-connect-common</artifactId>

View File

@ -23,7 +23,7 @@
<parent>
<groupId>org.mitre</groupId>
<artifactId>openid-connect-parent</artifactId>
<version>1.3.6.cnaf-20230726</version>
<version>1.3.6.cnaf-20230914</version>
<relativePath>..</relativePath>
</parent>
<build>

View File

@ -219,12 +219,14 @@ public class DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityServi
token.setScope(scopeService.toStrings(scopes));
// make it expire if necessary
if (client.getAccessTokenValiditySeconds() != null
&& client.getAccessTokenValiditySeconds() > 0) {
// make it always expire
if (client.getAccessTokenValiditySeconds() != null && client.getAccessTokenValiditySeconds() > 0) {
Date expiration =
new Date(System.currentTimeMillis() + (client.getAccessTokenValiditySeconds() * 1000L));
token.setExpiration(expiration);
} else {
token.setExpiration(new Date(System.currentTimeMillis()));
}
// attach the authorization so that we can look it up later

View File

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.mitre</groupId>
<artifactId>openid-connect-parent</artifactId>
<version>1.3.6.cnaf-20230726</version>
<version>1.3.6.cnaf-20230914</version>
<name>MITREid Connect</name>
<packaging>pom</packaging>
<parent>