Xero Node.js SDK: Inconsistent State Key Handling on Reconnection

Đang mở
#683 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
15/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
nodejs, typescript
Lĩnh vực
authentication

Hướng nghiên cứu

The payload names no file, function or test, so the only entry point is the reproduction steps: connect, disconnect from Xero's Connected Apps page, then reconnect within a minute with a different state value. Check whether the callback echoes the new state or the old one, and whether the cause lies in the SDK or in the caller's code. The issue has no decided fix, so 'done' is not yet defined. Confirm with a maintainer first.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

SDK you're using (please complete the following information):

  • Version [5.1.0]

Describe the bug

Hi,
As I debugging into this issue, here's what I've observed:
When I swiftly log in with Xero using their Node.js SDK (xero-node) and promptly disconnect, then attempt to reconnect:

This issue only occurs when the disconnection happens from Xero's Website > Connected Apps. Here's the sequence:

  1. Connect with the Node.js SDK.
  2. Disconnect from Xero's website.
  3. Then reconnect again using the Node.js SDK

========================================================================================

  1. Initially, I send a state key under the key = 662f065f05170899644a5a28.
  2. Upon receiving the callback from the Xero API endpoints, it echoes back the same state key = 662f065f05170899644a5a28.
  3. Upon attempting to reconnect (after disconnection from xero's website), I send a new state key = 662f081ed32ff9d3e845ecd7.
  4. However, on the second attempt, the Xero callback API endpoint still sends back the first state key = 62f065f05170899644a5a28.

The state key serves as an identifier to verify if the user is genuine and if the authentication request has been duly validated.
As I have meticulously reviewed the live server logs at every step, I am confident that I have not sent the wrong ID, and there is no possibility of error on my part in this matter.

To Reproduce

  1. Steps to reproduce the behavior:
  2. Begin by installing the latest version of the xero-node SDK, version 5.1.0.
  3. Set up the SDK with authentication and callback for a static user.
  4. On the initial connection, set the value in the state key to 1.
  5. After successfully establishing the connection, disconnect it from xero's website.
  6. Initiate the authentication process for the second time.
  7. This time, change the value in the state key to 2.
  8. Perform the connection, disconnection, and reconnection process promptly, within 30 seconds or a minute.
  9. Upon inspecting the callback API response during the second connection attempt, observe that Xero is sending the state key as 1 instead of 2. Ideally, it should reflect the updated value of 2.

Expected behavior
As described in the steps to reproduce the issue, during the first API callback, the state parameter correctly reflects the value of 1. However, upon the second callback, it is expected to send 2 as illustrated in the example. Instead, it continues to send 1.

Ngôn ngữ chính
TypeScript
Star
264
Fork
177
Merge trung bình
10 giờ 5 phút
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của XeroAPI/xero-node

Tất cả issue của XeroAPI/xero-node

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.