Always set access token exp claim
It follows RFC https://datatracker.ietf.org/doc/html/rfc9068 Bumped MitreID version 1.3.6.cnaf-20230914pull/1611/head
parent
521019fed8
commit
20a9ed1a1a
|
@ -22,7 +22,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>openid-connect-parent</artifactId>
|
<artifactId>openid-connect-parent</artifactId>
|
||||||
<groupId>org.mitre</groupId>
|
<groupId>org.mitre</groupId>
|
||||||
<version>1.3.6.cnaf-20230726</version>
|
<version>1.3.6.cnaf-20230914</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>openid-connect-client</artifactId>
|
<artifactId>openid-connect-client</artifactId>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>openid-connect-parent</artifactId>
|
<artifactId>openid-connect-parent</artifactId>
|
||||||
<groupId>org.mitre</groupId>
|
<groupId>org.mitre</groupId>
|
||||||
<version>1.3.6.cnaf-20230726</version>
|
<version>1.3.6.cnaf-20230914</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>openid-connect-common</artifactId>
|
<artifactId>openid-connect-common</artifactId>
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mitre</groupId>
|
<groupId>org.mitre</groupId>
|
||||||
<artifactId>openid-connect-parent</artifactId>
|
<artifactId>openid-connect-parent</artifactId>
|
||||||
<version>1.3.6.cnaf-20230726</version>
|
<version>1.3.6.cnaf-20230914</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -219,12 +219,14 @@ public class DefaultOAuth2ProviderTokenService implements OAuth2TokenEntityServi
|
||||||
|
|
||||||
token.setScope(scopeService.toStrings(scopes));
|
token.setScope(scopeService.toStrings(scopes));
|
||||||
|
|
||||||
// make it expire if necessary
|
// make it always expire
|
||||||
if (client.getAccessTokenValiditySeconds() != null
|
if (client.getAccessTokenValiditySeconds() != null && client.getAccessTokenValiditySeconds() > 0) {
|
||||||
&& client.getAccessTokenValiditySeconds() > 0) {
|
|
||||||
Date expiration =
|
Date expiration =
|
||||||
new Date(System.currentTimeMillis() + (client.getAccessTokenValiditySeconds() * 1000L));
|
new Date(System.currentTimeMillis() + (client.getAccessTokenValiditySeconds() * 1000L));
|
||||||
|
|
||||||
token.setExpiration(expiration);
|
token.setExpiration(expiration);
|
||||||
|
} else {
|
||||||
|
token.setExpiration(new Date(System.currentTimeMillis()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// attach the authorization so that we can look it up later
|
// attach the authorization so that we can look it up later
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -20,7 +20,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.mitre</groupId>
|
<groupId>org.mitre</groupId>
|
||||||
<artifactId>openid-connect-parent</artifactId>
|
<artifactId>openid-connect-parent</artifactId>
|
||||||
<version>1.3.6.cnaf-20230726</version>
|
<version>1.3.6.cnaf-20230914</version>
|
||||||
<name>MITREid Connect</name>
|
<name>MITREid Connect</name>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<parent>
|
<parent>
|
||||||
|
|
Loading…
Reference in New Issue