Update Acosix dependencies; fix use of deprecated API

This commit is contained in:
AFaust
2020-06-05 14:52:07 +02:00
parent 30a87ac620
commit 399419068f
4 changed files with 11 additions and 11 deletions

View File

@@ -21,7 +21,7 @@
<parent> <parent>
<groupId>de.acosix.alfresco.maven</groupId> <groupId>de.acosix.alfresco.maven</groupId>
<artifactId>de.acosix.alfresco.maven.project.parent-6.0.7</artifactId> <artifactId>de.acosix.alfresco.maven.project.parent-6.0.7</artifactId>
<version>1.3.0</version> <version>1.3.1</version>
</parent> </parent>
<groupId>de.acosix.alfresco.keycloak</groupId> <groupId>de.acosix.alfresco.keycloak</groupId>
@@ -79,7 +79,7 @@
<apache.httpclient.version>4.5.1</apache.httpclient.version> <apache.httpclient.version>4.5.1</apache.httpclient.version>
<apache.httpcore.version>4.4.3</apache.httpcore.version> <apache.httpcore.version>4.4.3</apache.httpcore.version>
<acosix.utility.version>1.1.0</acosix.utility.version> <acosix.utility.version>1.2.1</acosix.utility.version>
<ootbee.support-tools.version>1.1.0.0</ootbee.support-tools.version> <ootbee.support-tools.version>1.1.0.0</ootbee.support-tools.version>
</properties> </properties>

View File

@@ -638,7 +638,7 @@ public class IDMClientImpl implements InitializingBean, IDMClient
final AccessToken accessToken = tokens.getAccessToken(); final AccessToken accessToken = tokens.getAccessToken();
if ((accessToken.getExpiration() - this.deployment.getTokenMinimumTimeToLive()) <= Time.currentTime()) if ((accessToken.getExp() - this.deployment.getTokenMinimumTimeToLive()) <= Time.currentTime())
{ {
throw new AlfrescoRuntimeException("Failed to retrieve / refresh the access token with a longer time-to-live than the minimum"); throw new AlfrescoRuntimeException("Failed to retrieve / refresh the access token with a longer time-to-live than the minimum");
} }

View File

@@ -43,7 +43,7 @@ public class RefreshableAccessTokenHolder implements Serializable
protected final String refreshToken; protected final String refreshToken;
protected final int refreshExpiration; protected final long refreshExpiration;
/** /**
* Constructs a new instance of this class from an access token response, typically from an initial authentication or token refresh * Constructs a new instance of this class from an access token response, typically from an initial authentication or token refresh
@@ -64,7 +64,7 @@ public class RefreshableAccessTokenHolder implements Serializable
this.token = tokenResponse.getToken(); this.token = tokenResponse.getToken();
this.refreshToken = tokenResponse.getRefreshToken(); this.refreshToken = tokenResponse.getRefreshToken();
this.refreshExpiration = Time.currentTime() + (int) tokenResponse.getRefreshExpiresIn(); this.refreshExpiration = Time.currentTime() + tokenResponse.getRefreshExpiresIn();
} }
/** /**
@@ -93,7 +93,7 @@ public class RefreshableAccessTokenHolder implements Serializable
this.token = token; this.token = token;
this.refreshToken = refreshToken; this.refreshToken = refreshToken;
// no explicit refresh expiration, so assume validity period is 1/100th // no explicit refresh expiration, so assume validity period is 1/100th
this.refreshExpiration = Time.currentTime() - (accessToken.getExpiration() - Time.currentTime()) / 100; this.refreshExpiration = Time.currentTime() - (accessToken.getExp() - Time.currentTime()) / 100;
} }
/** /**
@@ -139,7 +139,7 @@ public class RefreshableAccessTokenHolder implements Serializable
*/ */
public boolean shouldRefresh(final int minTokenTTL) public boolean shouldRefresh(final int minTokenTTL)
{ {
final boolean shouldRefresh = this.refreshToken != null && this.accessToken.getExpiration() - minTokenTTL < Time.currentTime(); final boolean shouldRefresh = this.refreshToken != null && this.accessToken.getExp() - minTokenTTL < Time.currentTime();
return shouldRefresh; return shouldRefresh;
} }

View File

@@ -43,7 +43,7 @@ public class RefreshableAccessTokenHolder implements Serializable
protected final String refreshToken; protected final String refreshToken;
protected final int refreshExpiration; protected final long refreshExpiration;
/** /**
* Constructs a new instance of this class from an access token response, typically from an initial authentication or token refresh * Constructs a new instance of this class from an access token response, typically from an initial authentication or token refresh
@@ -64,7 +64,7 @@ public class RefreshableAccessTokenHolder implements Serializable
this.token = tokenResponse.getToken(); this.token = tokenResponse.getToken();
this.refreshToken = tokenResponse.getRefreshToken(); this.refreshToken = tokenResponse.getRefreshToken();
this.refreshExpiration = Time.currentTime() + (int) tokenResponse.getRefreshExpiresIn(); this.refreshExpiration = Time.currentTime() + tokenResponse.getRefreshExpiresIn();
} }
/** /**
@@ -93,7 +93,7 @@ public class RefreshableAccessTokenHolder implements Serializable
this.token = token; this.token = token;
this.refreshToken = refreshToken; this.refreshToken = refreshToken;
// no explicit refresh expiration, so assume validity period is 1/100th // no explicit refresh expiration, so assume validity period is 1/100th
this.refreshExpiration = Time.currentTime() - (accessToken.getExpiration() - Time.currentTime()) / 100; this.refreshExpiration = Time.currentTime() - (accessToken.getExp() - Time.currentTime()) / 100;
} }
/** /**
@@ -139,7 +139,7 @@ public class RefreshableAccessTokenHolder implements Serializable
*/ */
public boolean shouldRefresh(final int minTokenTTL) public boolean shouldRefresh(final int minTokenTTL)
{ {
final boolean shouldRefresh = this.refreshToken != null && this.accessToken.getExpiration() - minTokenTTL < Time.currentTime(); final boolean shouldRefresh = this.refreshToken != null && this.accessToken.getExp() - minTokenTTL < Time.currentTime();
return shouldRefresh; return shouldRefresh;
} }