Storage Access API (SAA), erişim tarayıcı ayarları tarafından reddedildiğinde kaynakta farklı olan iframe'lerin depolama alanı erişim izinleri istemesini sağlar.
Bazı web siteleri, kimlik doğrulaması için hem FedCM'yi hem de kaynak dışı iframe'lerin gerekli depolamaya erişmesine izin vermek için SAA'yı kullanabilir. Örneğin, idp.example, rp.example'a yerleştirilmişse ve idp.example, kişiselleştirilmiş içerik göstermek için kendi üst düzey çerezine depolama erişimi gerekiyorsa.
Bu senaryoda, kullanıcının iki farklı istemi onaylaması gerekir: biri kimlik doğrulama için, diğeri ise çerez erişimi vermek için. SAA, izin istemi tetikler. FedCM, güven sinyali olarak hareket ederek Storage Access API sürecini basitleştirir. Kullanıcı FedCM ile oturum açtıktan sonra, IdP tarafından başlatılan depolama alanı erişim istekleri otomatik olarak verilir. Böylece ek SAA istemlerine gerek kalmaz.
// In top-level rp.example:// Ensure FedCM permission has been granted.constcred=awaitnavigator.credentials.get({identity:{providers:[{configURL:'https://idp.example/fedcm.json',clientId:'123',}],}});// In an embedded IdP iframe:// Returns `true` if the user already has access to cookies, and `false` if// the user doesn't have access yet and needs to request it.consthasAccess=awaitdocument.hasStorageAccess()if(!hasAccess){// No user gesture is needed to approve storage access, and the call will be auto-granted.document.requestStorageAccess().then(e=>{//access cookies})}else{//the iframe already has access to third-party cookies}
Origin deneme katılımcıları, genel Storage Access API istemlerine kıyasla bağlama özgü bir FedCM istemi sayesinde sağlanan daha iyi kullanıcı deneyimini vurgulayarak olumlu geri bildirimler verdi.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2024-11-15 UTC."],[[["Chrome now uses FedCM as a trust signal for the Storage Access API, streamlining cross-origin iframe storage access when users are logged in with FedCM."],["This integration eliminates the need for separate Storage Access API prompts, simplifying the user experience and reducing prompt fatigue."],["Websites using both FedCM and the Storage Access API benefit from this feature, as users only need to authenticate once with FedCM for both login and storage access."],["Developers can learn more about implementation and feedback channels through provided documentation and issue tracking links."],["Positive feedback from origin trial participants suggests that FedCM-based storage access improves user experience compared to generic prompts."]]],["Chrome 131 utilizes FedCM as a trust signal for the Storage Access API (SAA). When a user logs in via FedCM, storage access requests from Identity Providers (IdPs) are automatically granted, removing the need for additional SAA prompts. Websites using both FedCM and SAA see streamlined access. Without FedCM, the user needs to approve separate prompts for authentication and cookie access. `document.requestStorageAccess()` becomes auto-granted, and cookies will be available. If `navigator.credentials.preventSilentAccess()` is called, storage access is not granted until reauthentication.\n"]]