-
Notifications
You must be signed in to change notification settings - Fork 47
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
Adding a mechanism to handle re-authentication for expired tokens #554
Merged
Conversation
This file contains 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
...dget/src/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.tsx
Outdated
Show resolved
Hide resolved
chat-widget/src/components/livechatwidget/common/createAdapter.ts
Outdated
Show resolved
Hide resolved
chat-widget/src/components/livechatwidget/common/initCallingSdk.ts
Outdated
Show resolved
Hide resolved
chat-widget/src/components/livechatwidget/common/initWebChatComposer.ts
Outdated
Show resolved
Hide resolved
chat-widget/src/components/livechatwidget/common/liveChatConfigUtils.ts
Outdated
Show resolved
Hide resolved
chat-widget/src/components/livechatwidget/common/persistentChatHelper.ts
Show resolved
Hide resolved
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.
Thank you for your contribution. Before submitting this PR, please include:
Id of the task, bug, story or other reference.
Description
Include a description of the problem to be solved
for authenticated chats, token is obtained and passed just once, this causes a problem for chats that sessions extends beyond the expiration time of the token.
This includes "abandoned" sessions, which then will fail to call close session endpoints or post surveys, we have cases for other endpoints under same circusntances.
Solution Proposed
Detail what is the solution proposed, include links to design document if required or any other document required to support the solution
The combination of Facade and decorator pattern blended into the FacadeChatSDK component, which will wraps the chatSDK calls and evaluates expiration token before continues,
in case the token is expired, it will call again the getAuthToken function to obtain a new token and continue with the execution, in this way it ensures that flow continues without authentication issues.
NOTE : IT IS RESPONSABILITY OF THE DEVELOPER TO IMPLEMENT THE getAuthToken FUNCTION THAT RETURNS A VALID TOKEN
Acceptance criteria
Define what are the conditions to consider the PR has achieved the intended goal
No authenticated Widgets
Test cases and evidence
Include what tests cases were considered, any evidence of testing for future references, to identify any corner cases, etc
Storybooks
Core Scenarios validated
- If during the conversation, the token is expired, and the new token is invalid or the function doesnt return a new token, the widget wont crash, so the end user doesnt lost the conversation, but any interaction with backend will fail
Sanity Tests
A11y
Please provide justification if any of the validations has been skipped.