Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for getting OAuth token info #205

Merged

Conversation

mrashed-dev
Copy link
Contributor

Description

This PR adds support for the /v3/connect/tokeninfo endpoint.

Usage

There are two methods that are part of the Auth resource that allow you to get information on a token; one for the ID token (idTokenInfo) and one for the access token (accessTokenInfo).

NylasClient nylas = new NylasClient.Builder("API_KEY").build();

// Get information on an ID token
Response<TokenInfoResponse> idTokenInfo = nylas.auth.idTokenInfo("idToken");

// Get information on an access token
Response<TokenInfoResponse> accessTokenInfo = nylas.auth.accessTokenInfo("accessToken");

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (42cd063) 78.32% compared to head (2ab29ad) 78.53%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #205      +/-   ##
============================================
+ Coverage     78.32%   78.53%   +0.21%     
- Complexity      196      199       +3     
============================================
  Files            29       29              
  Lines           715      722       +7     
  Branches         69       69              
============================================
+ Hits            560      567       +7     
  Misses          117      117              
  Partials         38       38              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mrashed-dev mrashed-dev merged commit 65b8977 into main Feb 9, 2024
2 checks passed
@mrashed-dev mrashed-dev deleted the AV-3241-kotlin-sdk-add-support-for-tokeninfo-endpoint branch February 9, 2024 17:08
@mrashed-dev mrashed-dev mentioned this pull request Feb 12, 2024
mrashed-dev added a commit that referenced this pull request Feb 12, 2024
# Changelog
### Added
* Add support for getting OAuth token info (#205)

### Changed
* Fix schema issues in the `Event`, `Message`, `Draft`, and
`CodeExchangeResponse` models (#203, #204, #205)

# License
<!-- Your PR comment must contain the following line for us to merge the
PR. -->
I confirm that this contribution is made under the terms of the MIT
license and that I have the authority necessary to make this
contribution on behalf of its copyright owner.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants