Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ public class ApiClient {

/**
* Configures a listener which is notified when a new access token is received.
* @param accessTokenListener Acesss token listener
* @param accessTokenListener Access token listener
*/
public void registerAccessTokenListener(AccessTokenListener accessTokenListener) {
OAuth apiAuthorization = getAuthorization(OAuth.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.util.Collection;
public abstract class OAuth implements RequestInterceptor {

//https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4
static final int LEEWAY_SENCONDS = 10;
static final int LEEWAY_SECONDS = 10;

static final int MILLIS_PER_SECOND = 1000;

Expand Down Expand Up @@ -90,7 +90,7 @@ public abstract class OAuth implements RequestInterceptor {
*/
public synchronized void setAccessToken(String accessToken, Integer expiresIn) {
this.accessToken = accessToken;
this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SENCONDS;
this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SECONDS;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public void configureAuthorizationFlow(String clientId, String clientSecret, Str

/**
* Configures a listener which is notified when a new access token is received.
* @param accessTokenListener Acesss token listener
* @param accessTokenListener Access token listener
*/
public void registerAccessTokenListener(AccessTokenListener accessTokenListener) {
OAuth apiAuthorization = getAuthorization(OAuth.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public abstract class OAuth implements RequestInterceptor {

//https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4
static final int LEEWAY_SENCONDS = 10;
static final int LEEWAY_SECONDS = 10;

static final int MILLIS_PER_SECOND = 1000;

Expand Down Expand Up @@ -90,7 +90,7 @@ public synchronized String getAccessToken() {
*/
public synchronized void setAccessToken(String accessToken, Integer expiresIn) {
this.accessToken = accessToken;
this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SENCONDS;
this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SECONDS;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public void configureAuthorizationFlow(String clientId, String clientSecret, Str

/**
* Configures a listener which is notified when a new access token is received.
* @param accessTokenListener Acesss token listener
* @param accessTokenListener Access token listener
*/
public void registerAccessTokenListener(AccessTokenListener accessTokenListener) {
OAuth apiAuthorization = getAuthorization(OAuth.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public abstract class OAuth implements RequestInterceptor {

//https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4
static final int LEEWAY_SENCONDS = 10;
static final int LEEWAY_SECONDS = 10;

static final int MILLIS_PER_SECOND = 1000;

Expand Down Expand Up @@ -90,7 +90,7 @@ public synchronized String getAccessToken() {
*/
public synchronized void setAccessToken(String accessToken, Integer expiresIn) {
this.accessToken = accessToken;
this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SENCONDS;
this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SECONDS;
}

}
}