Effettuare chiamate a Gestore delle credenziali per conto di altre parti per le app con privilegi
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Le app con privilegi, come i browser web, possono effettuare una chiamata a Gestore delle credenziali per conto di altri soggetti impostando il parametro origin nei metodi GetCredentialRequest() e CreatePublicKeyCredentialRequest() di Gestore delle credenziali.
origin rappresenta l'applicazione o il sito web da cui proviene una richiesta e viene utilizzato dalle passkey per proteggere dagli attacchi di phishing.
I server di un'app sono tenuti a controllare i dati del client origin con una lista consentita di app e siti web approvati. Se il server riceve una richiesta da un'app o un sito web da un'origine non riconosciuta, la richiesta dovrebbe essere rifiutata.
Questo documento descrive come impostare l'origine per queste app di chiamata con privilegi e come verificare che queste app siano autorizzate a effettuare chiamate per conto di altre parti.
Imposta l'origine dell'app per le chiamate
Per ottenere le credenziali per conto di un'altra parte attendibile, il fornitore di credenziali che le fornisce deve aggiungere la tua app a un elenco di chiamanti con privilegi a cui è consentito ottenere questo tipo di accesso. Quindi, utilizza setOrigin() nelle richieste
createCredential() e getCredential() per impostare il valore
origin.
Per le app con privilegi come i browser web che devono gestire credenziali di terze parti, Gestore delle password di Google richiede l'approvazione per gestire queste credenziali. Ciò garantisce che solo le app attendibili possano accedere e gestire le credenziali utente per i servizi esterni. Per ottenere l'approvazione per la gestione delle credenziali di terze parti, compila il modulo di richiesta per aprire un ticket e far esaminare la tua richiesta.
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-27 UTC.
[null,null,["Ultimo aggiornamento 2025-07-27 UTC."],[],[],null,["# Make Credential Manager calls on behalf of other parties for privileged apps\n\nPrivileged apps such as web browsers can make a Credential Manager call on\nbehalf of other relying parties by setting the `origin` parameter in Credential\nManager's [`GetCredentialRequest()`](/reference/androidx/credentials/GetCredentialRequest#GetCredentialRequest(kotlin.collections.List,kotlin.String,kotlin.Boolean,android.content.ComponentName,kotlin.Boolean)) and\n[`CreatePublicKeyCredentialRequest()`](/reference/androidx/credentials/CreatePublicKeyCredentialRequest#CreatePublicKeyCredentialRequest(kotlin.String,kotlin.ByteArray,kotlin.Boolean,kotlin.String,kotlin.Boolean)) methods.\n\nThe [`origin`](https://www.w3.org/TR/webauthn-2/#dom-collectedclientdata-origin) represents the application or website that a\nrequest comes from, and is used by passkeys to protect against phishing attacks.\nAn app's servers are required to check the client data `origin` against an\nallowlist of approved apps and websites. If the server receives a request from\nan app or website from an unrecognized origin, the request should be rejected.\nThis document describes how to set the origin for such privileged calling apps,\nand how to verify such apps are allowed to make calls on behalf of other\nparties.\n\nSet the origin of the calling app\n---------------------------------\n\nTo get credentials on behalf of another relying party, the credential provider\nthat supplies the credentials must add your app to a list of privileged callers\nthat are allowed to get such access. Then, use [`setOrigin()`](/reference/android/credentials/GetCredentialRequest.Builder#setOrigin(java.lang.String)) on\n[`createCredential()`](/reference/kotlin/androidx/credentials/CredentialManager#createCredential(android.content.Context,androidx.credentials.CreateCredentialRequest)) and [`getCredential()`](/reference/kotlin/androidx/credentials/CredentialManager#getCredential(android.content.Context,androidx.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle)) requests to set the\n`origin` value.\n| **Note:** The `origin` parameter in the `createCredential()` and `getCredential()` methods is only effective in API levels 34 (Android 14) and higher.\n\nFor privileged apps such as web browsers that need to handle third party\ncredentials, Google Password Manager requires approval to handle those\ncredentials. This ensures that only trusted apps are able to access and manage\nuser credentials for external services. To be approved for handling third party\ncredentials, [complete the request form](https://docs.google.com/forms/d/e/1FAIpQLScRuk9tTg0QPfSWl9SbpbIorX8xx2FCXlmoUYftCX2MxG4qyg/viewform) to open a ticket and\nhave your request reviewed."]]