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>
|
||||
<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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue