Refactor deprecated method and update keycloak to 10.0.2
MODIFY
manager/ui/war/src/main/java/io/apiman/manager/ui/server/beans/BearerTokenCredentialsBean.java
manager/ui/war/src/main/java/io/apiman/manager/ui/server/beans/BearerTokenCredentialsBean.java
@@ -27,7 +27,7 @@ public class BearerTokenCredentialsBean implements Serializable {
private static final long serialVersionUID = -876646690486553629L;
private String token;
- private int refreshPeriod; // in seconds
+ private long refreshPeriod; // in seconds
/**
* Constructor.
@@ -52,14 +52,14 @@ public class BearerTokenCredentialsBean implements Serializable {
/**
* @return the refreshPeriod
*/
- public int getRefreshPeriod() {
+ public long getRefreshPeriod() {
return refreshPeriod;
}
/**
* @param refreshPeriod the refreshPeriod to set
*/
- public void setRefreshPeriod(int refreshPeriod) {
+ public void setRefreshPeriod(long refreshPeriod) {
this.refreshPeriod = refreshPeriod;
}

MODIFY
manager/ui/war/src/main/java/io/apiman/manager/ui/server/kc/KeyCloakBearerTokenGenerator.java
manager/ui/war/src/main/java/io/apiman/manager/ui/server/kc/KeyCloakBearerTokenGenerator.java
@@ -49,7 +49,7 @@ public class KeyCloakBearerTokenGenerator implements ITokenGenerator {
if (session != null) {
bean.setToken(session.getTokenString());
int nowInSeconds = getCurrentTime();
- int expiresInSeconds = session.getToken().getExpiration();
+ long expiresInSeconds = session.getToken().getExp();
if (expiresInSeconds <= nowInSeconds) {
bean.setRefreshPeriod(1);

MODIFY
pom.xml
pom.xml
<version.org.jboss.spec.javax.transaction.jboss-transaction-api_1.2_spec>1.0.0.Final</version.org.jboss.spec.javax.transaction.jboss-transaction-api_1.2_spec>
<version.org.jboss.spec.javax.ws.jboss-jaxrs-api_2.0_spec>1.0.0.Final</version.org.jboss.spec.javax.ws.jboss-jaxrs-api_2.0_spec>
<version.org.jboss.weld.weld>2.3.3.Final</version.org.jboss.weld.weld>
- <version.org.keycloak>3.4.3.Final</version.org.keycloak>
+ <version.org.keycloak>10.0.2</version.org.keycloak>
<version.org.mockito>1.9.5</version.org.mockito>
<version.org.mvel>2.2.7.Final</version.org.mvel>
<version.org.osgi>4.2.0</version.org.osgi>

Refactor deprecated method and update keycloak to 10.0.2 (#886)