Skip to content

[SDK-2622] Add expiresAt to token response#357

Merged
jimmyjames merged 7 commits intomasterfrom
add-expires-at-to-token-response
Jul 1, 2021
Merged

[SDK-2622] Add expiresAt to token response#357
jimmyjames merged 7 commits intomasterfrom
add-expires-at-to-token-response

Conversation

@jimmyjames
Copy link
Copy Markdown
Contributor

Changes

The response from /oauth/token includes an expires_in field, which is the time (from issuance) that the access token expires in. As noted in #356, customers wishing to know the expiry status of the token need to manage this manually, by calculating the expiry time from the issuance and expires_in value. This change introduces a new calculated value to TokenHolder that represents the expiration time of the access token.

Reviewer notes

  • See the individual commit history to see how tests and refactorings were introduced to mitigate any unintended side effects (added tests for regression cases, refactored to custom deserializer, then added new calculated field)
  • Date type was used for the new expiresAt field, to provide consistency with other types (customers can use Date.from(Instant value) to take advantage of modern date/time APIs, as the unit tests demonstrate)

@jimmyjames jimmyjames added this to the v1-Next milestone Jun 24, 2021
@jimmyjames jimmyjames marked this pull request as ready for review June 28, 2021 14:14
@jimmyjames jimmyjames requested a review from a team as a code owner June 28, 2021 14:14
@jimmyjames jimmyjames merged commit fd36528 into master Jul 1, 2021
@jimmyjames jimmyjames deleted the add-expires-at-to-token-response branch July 1, 2021 00:28
@lbalmaceda lbalmaceda modified the milestones: v1-Next, 1.32.0 Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants