forcedotcom / forcedotcom/SalesforceCanvasJavascriptSDK

Unable to subscribe using `Sfdc.canvas.client.subscribe` method from within the Canvas App

Open
#14 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
43
Forks
34
PR merge metrics
No merged PRs in 30d

Description

Subscribing in the aura component works without any issues but when I try to subscribe from within the canvas app (cross domain hosting) I can see a warning in chrome network tab for Set-Cookie headers:
- t=xxx; path=/cometd/; HttpOnly
- sfproxy-id="xxx"; Max-Age=3600; HttpOnly

This Set-Cookie header didn't specify a "SameSite" attribute and was defaulted to "SameSite=Lax," and was blocked because it came from a cross-site response which was not the response to a top-level navigation. The Set-Cookie had to have been set with "SameSite=None" to enable cross-site usage.

And the subscribe call fails with the response:

```
[
{
"advice": {
"interval": 0,
"reconnect": "handshake"
},
"channel": "/meta/subscribe",
"id": "2",
"error": "403::Unknown client",
"successful": false
}
]
```

The handshake/subscribe sequence is repeated 3 times and stops.

Not sure if it fails due to the cookie not being sent back or if this is unrelated but there is no way to debug this any further. Any advice?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.