Skip to content

Consent to Continue Out Created by Staff – User Receives 403 Error When Downloading Receipt #34460

Closed

Description

@gunanagar

Describe the bug in current situation
A Consent to Continue Out filing created by a Staff user can be viewed successfully by a User in Filing History. However, when the user attempts to download the Receipt, the system returns a 403 Forbidden error. All other filing documents download successfully.

Steps to Reproduce
Steps to reproduce the behaviour:
Log in as Staff.
Create a Consent to Continue Out filing for business BC1200832.
Verify the filing appears in Filing History.
Download all available documents, including the Receipt.
Receipt downloads successfully.
Log out and log in as an External User.
Access the same business (BC1200832).
Open Filing History.
Attempt to download the Receipt.

Actual/ observed behavior/ results
The Receipt download fails with a 403 Forbidden error.
Other filing documents can be downloaded successfully.

Expected behavior

The external user should be able to download the Receipt, along with all other filing documents, without receiving a 403 Forbidden error

Screenshots/ Visual Reference/ Source
Screenshot 2026-08-04 at 12.36.30 PM.png

Screenshot 2026-08-04 at 12.26.27 PM (1).png

Screenshot 2026-08-04 at 12.17.56 PM.png

Screenshot 2026-08-04 at 12.11.47 PM.png

Root Cause Analysis (RCA) results

Activity

  1. added
    bug
    Entities Team
    on Aug 4, 2026
  2. changed the title [-]Consent to Continue Out Created in Staff and View in User got 403 while downloading Receipt [/-] [+]Consent to Continue Out Created by Staff – User Receives 403 Error When Downloading Receipt[/+] on Aug 4, 2026
  3. mstanton1 commented on Aug 13, 2026

    @mstanton1
    Collaborator

    Suspected that this will only occur if the filing was done by another user (e.g. end user) and then the filing is viewed by staff.

  4. added
    UAT
    on Aug 13, 2026
  5. vikas-gov commented on Aug 13, 2026

    @vikas-gov
    Collaborator

    related ticket for reference #33861

  6. assigned and unassigned on Aug 14, 2026
  7. benjamin-bc-gov commented on Aug 19, 2026

    @benjamin-bc-gov
    Collaborator

    Root cause

    When Staff creates a filing with fees waived, the payment record in Pay API is tied to the Staff account. When an external user tries to download the receipt, it uses the external user's token to call Pay API — but Pay API only allows the account that owns the payment to access it, so it returns 403.

  8. vikas-gov commented on Aug 20, 2026

    @vikas-gov
    Collaborator

    Next Steps: Review with Pay team and confirm expected behavior for staff transactions/receipts.
    Owner: @mstanton1

  9. mstanton1 commented on Aug 20, 2026

    @mstanton1
    Collaborator

    Questions sent to pay team. @rebturg you've been cc'd for knowledge building.

  10. benjamin-bc-gov commented on Aug 20, 2026

    @benjamin-bc-gov
    Collaborator

    `
    Before the fix: legal-api forwarded the external user's token → Pay API saw a regular user whose account didn't own the invoice ( owned by staff ) → 403 .

    Proposed fix: legal-api sends AccountService.get_bearer_token() → Pay API sees a system account → is_system() returns True → account ownership check skipped → receipt generated successfully.

    The is_system() bypass was deliberately designed in Pay API for exactly this service-to-service scenario.
    `

  11. mstanton1 commented on Aug 26, 2026

    @mstanton1
    Collaborator

    Sent follow up to Pay team today. @vikas-gov to keep our sprint going we should be able to push this through. If there are concerns flagged by pay we'd need to revisit the approach before our launch Sept 17th.

  12. self-assigned this
    on Aug 26, 2026
  13. mstanton1 commented on Aug 26, 2026

    @mstanton1
    Collaborator

    Note: Follow up from Pay team was received noting in their opinion anyone on an affiliated account (user/coordinator) should be able to see a receipt created via a staff filing - which is what we are tackling here.

    Transactions and Statement restrictions logic is unclear.

  14. gunanagar commented on Aug 26, 2026

    @gunanagar
    CollaboratorAuthor

    Retested after the fix, I can download the receipt, which was filled by the staff

    Screenshot 2026-08-26 at 4.26.33 PM.png

  15. gunanagar commented on Aug 26, 2026

    @gunanagar
    CollaboratorAuthor

    Also tested with other filling; it's working now. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Entities TeamOn HoldUATbugtimeboxed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions