Tripletex / tripletex-api2

Tripletex API 2 resources and examples
MIT License
38 stars 43 forks source link

Example code for TripletexApiClient causes exceptions #73

Open JorgenLangemyr opened 1 year ago

JorgenLangemyr commented 1 year ago

The example code for automatically generating a session token should be updated (tripletex-api2/examples/java-gradle/token/src/main/java/no/tripletex/api/v2/TripletexApiClient.java)

ZonedDateTime error:

tokenValidUntil is stored as ZonedDateTime on line 39 session token is generated with date only at line 100 but the later validity checks still use the ZonedDateTime to check if the token is valid, which includes the time component of ZonedDateTime. This will result in Unauthorized exceptions between midnight and the time of day in the tokenValidUntil field.

StackOverflowException: buildCall ends up calling sessionApi.delete, which in turn calls buildCall, etc.