-
Notifications
You must be signed in to change notification settings - Fork 5
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
Apis to find if 3p cookies are enabled or not? #6
Comments
I assume the main frame's site and the iframe's site are non-opaque, and are served over HTTPS, correct? If so, that's interesting - this is not the intended behavior in Chrome (and is not what the spec requires), and we have a test that shows that Chrome follows the intended behavior. Can you reproduce this bug? If so, can you share any info on what you're doing (and what version of Chrome you are using)? Is your browser using any enterprise policies (E.g. CookiesBlockedForUrls) or extensions? (Check |
Unfortunately in the latest builds( 116) i can't really test this anymore as i'm not getting any browser permissions popups at all. |
Is that because Chrome is reusing the permission decisions you've already made while testing, instead of asking you again? If so, you can revoke those decisions through the UI on |
It also just occurred to me: in #6 (comment) you said you're testing in Chrome 116. This feature was not finished in time for Chrome 116; please use Chrome 117 for your testing (as noted in the testing instructions). The behavior of |
this doesn't seem to work, I followed the exact instructions as detailed here https://github.com/cfredric/chrome-storage-access-api#testing-instructions Under chrome://settings/content/storageAccess I see
|
Thank you that's helpful. here is what i found:
Next time i deleted the permission and tried again , popup wouldn't show up. seems like this time chrome is automatically granting access and doesn't require a user interaction and it doesn't respect the chrome://settings/content/storageAccess settings ( like cleaning it off or turning off permissions fully). Could you clarify on this? Confusion for me here is , i wouldn't want to forcefully show request access banner in all cases, meaning i would want this to show up where customers doesn't have access to the 3rd party cookies. The way i determine the same is by doing a quick cookie test by running a small Javascript within an embedded context, which first set a cookie with
So what i see here is , this new RSA chrome feature is specifically targeting request storage access grants and my cookie test would always results in true for some reasons and my site works as well without even RSA. |
Update: I was able block 3p cookies by using privacy settings, but now RSA flow would show up but isn't granting access to any 3p cookies on the embedded domain. i clearly see entries within |
Can you please share what version of Chrome you are testing? You can find this on
I cannot reproduce this behavior in
If your site is working even without calling
I'm also not able to reproduce this. Can you provide clear, specific reproduction steps and let me know what version of Chrome you are using? Additionally, are you using any extensions? |
117.0.5894.0 (Official Build) canary (arm64) Will provide the exact steps |
Aha, that is just barely too old to have the correct behavior, and I think it explains some of what you're seeing. Specifically, that build doesn't include this commit, which changed All of the Chrome release branches (besides Stable, and Android's canary DCHECK build) are shipping a newer version than that. Can you please upgrade Chrome (visit |
I also just realized that you provided that version in a previous comment earlier today, and I didn't see it. Sorry about that! |
Tested the same on
in addition now i see below error as well
|
this goes away as soon as i enable Experimental third-party storage partitioning flag , will this be enabled by default when cookies phase out happens? In terms of steps
in our case cookies are available but not accessible inside embedded context Screenshare.-.2023-08-31.3_13_35.PM.mp4 |
I'm not involved in that project, so I don't know about their plans other than what they've already announced publicly. This message indicates that it will be enabled by default next month. Thanks for the description of your use case and the screenshare, those are helpful. I think whatever's going on here is subtle, since it's related to navigation, as opposed to subresource fetches or script access. Some followup questions:
Navigations of the frame that got storage access (as opposed to subresource requests from the frame that got storage access) can only use the third-party cookies under certain circumstances:
FWIW, we do have some tests here (and more here) that illustrate (and verify) the expected behaviors in Chrome. Maybe you can take a look at those to see what your code does differently? |
yes it's the same origin
No
Embedded iframe instructs top level page to load the desired same origin page, so in my case it's the top page. this is important as in few cases customer may not even want to load any pages rather they show their own custom implementation.
this does not seem practical. In my case -> top level domain loads the desired embedded resource , and because of all the cookie issues now it has a pre-requisite to load /request-storage-access page (rsa page) hosted on the same origin of embedded resource and then embedded rsa page does all the request access and once after the grant it instructs the top level domain who opened rsa page about the grant and then top level domain decides to load the actual same origin desired page. |
Unfortunately this is necessary for security reasons. If the top-level document were allowed to navigate a frame that has storage access to a page of its choosing, and the navigation included the frame's unpartitioned cookies, that would be a vector for a cross-site request forgery attack. Please see here for lots of discussion on possible attacks using the Storage Access API. Your application should be able to work around this restriction by changing the communication flow slightly:
If that would work for you, please give it a try, and let me know if you run into more problems. |
Yup, trying the same already! will keep you posted |
Hi @jagadeeshaby, any update? If I don't hear from you in a few days I'll assume that we found the root of the issue, and I'll consider this issue closed. |
Updating :) |
So i went ahead and updated the flow, it seem to work fine. but now i have problem testing end to end again by clearing the state. Below video shows that there is nothing show up on embedded content settings even then the access is granted and i'm able to load the app. Screenshare.-.2023-09-06.10_24_00.AM.mp4Same time , on localhost i clearly see new entries and browser popup for permissions. i double checked cookie settings and allowed websites everything looks fine. |
The new flow is
i see that the RSA flow is working as intended just that not able to test the browser popup as it doesn't show up. are there any implicit grants based on usage? |
No, the only implicit grants supported by Chrome are via First-Party Sets (but I can see that you're not using the command-line flag that would make those relevant right now).
I suspect this is because your page relies on the third-party cookies during navigation, rather than during the embedded document's lifetime. I'd guess the pageinfo bubble only shows up when the embedded page indicates a need for the You should still be able to reset the state by clearing the permissions on cc @xchrdw, FYI. |
Not really ,as i mentioned earlier i don't see any entries here.
Not sure i follow, do you believe this is a bug or this is how it's expected to work? Great that it works, i worry that this being a bug. |
Okay i found the root cause!! Seems like chrome beta doesn't list the org managed policies but in turn applies those. So in my case the domain i was trying to use is allowed to use cookies by the policy and hence cookie access was granted implicitly and i tried the other URL which isn't included in the policy which works as expected. Feel free to close the Issue. thanks for all the input. Hope to test this out chrome GA version soon |
Do you mean that the CookiesAllowedForUrls policy was applying? If so, this should be reflected as an entry on the chrome://settings/content/siteData page. If it's not, that's certainly a bug. |
i believe so, i do see these entries on chrome but on chrome beta i only see that your browser is managed and doesn't list the allow listed URLs
I do see those URLs under /siteData. i was expecting this to appear under chrome://settings/content/storageAccess as well but it's not. |
Circling back to this after some vacation - in summary of what we discovered in this issue:
Seems like Chrome was behaving as intended and now you are unblocked. Closing. |
As of now i'm relying on
hasStorageAccess()
i presume this is not exactly equal to this application has 3p cookie access or not correct? For Example after enabling 3p cookies myself ,hasStorageAccess
returns false and i need to invoke RSA to proceed which i don't want to happen. So is there a better alternative exists today?For now as a workaround i'm using samesite:none, set cookie and get cookie method within the iframe to quickly validate whether the embedded iframe has access to cookie or not and then proceed with RSA and showing the banner, it seems to work well.
For me use case is, i expect our enterprise customers to use chrome policies to allow cookies, for which i want to skip RSA flow and directly take them to application.
The text was updated successfully, but these errors were encountered: