Make refresh token request only if appKey and appSecret is present#81
Open
mangatinanda wants to merge 2 commits intoringcentral:masterfrom
Open
Make refresh token request only if appKey and appSecret is present#81mangatinanda wants to merge 2 commits intoringcentral:masterfrom
mangatinanda wants to merge 2 commits intoringcentral:masterfrom
Conversation
Contributor
This is core SDK functionality, it works exactly as it was required :) The change is OK, but it breaks tests, please fix the CI. |
7dc1cba to
f2a8310
Compare
Contributor
Author
|
@kirill-konshin Fixed tests. |
| "access_token_ttl": this._auth.data().expires_in + 1, | ||
| "refresh_token_ttl": this._auth.data().refresh_token_expires_in + 1 | ||
| }); | ||
| } |
Contributor
There was a problem hiding this comment.
What if otherwise? The rest of the function relies on fact that there is a response.
Contributor
There was a problem hiding this comment.
Are you still interested in this PR? Can you fix it or should I close?
Contributor
Author
There was a problem hiding this comment.
I will close this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It doesn't make sense for customer facing apps(Ex: Web App) to expose appKey and appSecret.
In all such cases,
beforeRefreshevent should be used to refresh the token instead of SDK making the refresh token request.In our case, we are making a refresh token request to our own server endpoint which in turn makes a request to ringcentral refresh token API endpoint with HTTP Basic scheme using the app key and app secret.