Skip to content
Open
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
4 changes: 2 additions & 2 deletions authentication/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>authentication-sdk</artifactId>
<packaging>jar</packaging>
<name>APS Java SDK : Authentication SDK</name>
<version>0.1.0-beta</version>
<version>0.1.1-beta</version>
<description>Client SDK for Authentication API</description>
<url>https://aps.autodesk.com/</url>
<licenses>
Expand Down Expand Up @@ -152,7 +152,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<javax-annotation-version>1.3.2</javax-annotation-version>
<swagger-annotations-version>2.2.30</swagger-annotations-version>
<autodesk-sdkmanager-version>0.1.0-beta</autodesk-sdkmanager-version>
<autodesk-sdkmanager-version>0.1.1-beta</autodesk-sdkmanager-version>
<code-findbugs-version>3.0.2</code-findbugs-version>
<maven-compiler-plugin-version>3.8.1</maven-compiler-plugin-version>
<maven-enforcer-plugin-version>3.5.0</maven-enforcer-plugin-version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

package com.autodesk.aps.authentication.model;

import java.time.Instant;
import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
Expand Down Expand Up @@ -58,7 +59,7 @@ public class TwoLeggedToken {
private Integer expiresIn;

public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at";
private Integer expiresAt;
private Long expiresAt;

public TwoLeggedToken accessToken(String accessToken) {

Expand Down Expand Up @@ -134,10 +135,11 @@ public Integer getExpiresIn() {
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setExpiresIn(Integer expiresIn) {
this.expiresIn = expiresIn;
// set expiresAt based on expiresIn
this.expiresAt = Instant.now().getEpochSecond() + expiresIn;
}

public TwoLeggedToken expiresAt(Integer expiresAt) {

public TwoLeggedToken expiresAt(Long expiresAt) {
this.expiresAt = expiresAt;
return this;
}
Expand All @@ -152,13 +154,13 @@ public TwoLeggedToken expiresAt(Integer expiresAt) {
@JsonProperty(JSON_PROPERTY_EXPIRES_AT)
@JsonInclude(value = JsonInclude.Include.NON_NULL)

public Integer getExpiresAt() {
public Long getExpiresAt() {
return expiresAt;
}

@JsonProperty(JSON_PROPERTY_EXPIRES_AT)
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public void setExpiresAt(Integer expiresAt) {
public void setExpiresAt(Long expiresAt) {
this.expiresAt = expiresAt;
}

Expand Down
2 changes: 1 addition & 1 deletion samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<autodesk-modelderivative-sdk-version>0.1.0-beta</autodesk-modelderivative-sdk-version>
<autodesk-datamanagement-sdk-version>0.1.0-beta</autodesk-datamanagement-sdk-version>
<autodesk-authentication-sdk-version>0.1.0-beta</autodesk-authentication-sdk-version>
<autodesk-authentication-sdk-version>0.1.1-beta</autodesk-authentication-sdk-version>
<autodesk-webhooks-sdk-version>0.1.0-beta</autodesk-webhooks-sdk-version>
<autodesk-oss-sdk-version>0.1.0-beta</autodesk-oss-sdk-version>
<maven-compiler-plugin-version>3.8.1</maven-compiler-plugin-version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public class AuthenticationSample {
String clientSecret = dotenv.get("CLIENT_SECRET");
String accessToken = dotenv.get("ACCESS_TOKEN");


void initialize() {
SdkManager sdkManager = SdkManagerBuilder.create()
.addLogger(new ApsLogger(Level.DEBUG))
Expand All @@ -50,8 +49,8 @@ void getTwoLeggedToken() {
System.out.println("ExpiresIn : " + response.getExpiresIn());
System.out.println("TokenType : " + response.getTokenType());

Instant expiresAtInstant = Instant.ofEpochMilli(response.getExpiresIn());
LocalDateTime expiresAtLocal = LocalDateTime.ofInstant(expiresAtInstant, ZoneId.systemDefault());
LocalDateTime expiresAtLocal = LocalDateTime.ofInstant(Instant.ofEpochSecond(response.getExpiresAt()),
ZoneId.systemDefault());
System.out.println("ExpiresAt (Local Time) : " + expiresAtLocal);

} catch (Exception e) {
Expand Down
8 changes: 4 additions & 4 deletions sdkmanager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>sdkmanager</artifactId>
<packaging>jar</packaging>
<name>APS Java SDK : SDK Manager</name>
<version>0.1.0-beta</version>
<version>0.1.1-beta</version>
<description>Common SDK Manager to support the various Autodesk Platform Services SDKs.</description>
<url>https://aps.autodesk.com/</url>
<licenses>
Expand Down Expand Up @@ -119,9 +119,9 @@
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<resilience4j.version>2.2.0</resilience4j.version>
<httpcomponents.version>5.5</httpcomponents.version>
<httpcomponents.version>5.5.1</httpcomponents.version>
<jackson.version>2.15.3</jackson.version>
<slf4j.version>2.0.9</slf4j.version>
<logback.version>1.4.12</logback.version>
<slf4j.version>2.0.17</slf4j.version>
<logback.version>1.5.21</logback.version>
</properties>
</project>