Home / Market / phone number verification

phone number verification

Verify user phone numbers without SMS in an Android app using the Credential Manager DigitalCredential API, OpenID4VP, and carrier-issued TS.43 tokens. Use this skill whenever the user asks to verify phone numbers without SMS, implement carrier-based phone number verification in an Android project, perform a TelephonyManager.getSimCarrierId carrier precheck, or request a TS.43 Digital Credential using CredentialManager, GetDigitalCredentialOption, GetCredentialRequest, DigitalCredential, and dc-

skill★ 108590 dlgithubApache-2.0Install in CosmosUpstream Source

Documentation & Preview

--- name: phone-number-verification description: Verify user phone numbers without SMS in an Android app using the Credential Manager DigitalCredential API, OpenID4VP, and carrier-issued TS.43 tokens. Use this skill whenever the user asks to verify phone numbers without SMS, implement carrier-based phone number verification in an Android project, perform a TelephonyManager.getSimCarrierId carrier precheck, or request a TS.43 Digital Credential using CredentialManager, GetDigitalCredentialOption, GetCredentialRequest, DigitalCredential, and dc-authorization+sd-jwt DCQL queries. Produces Android client-side carrier precheck and Credential Manager TS.43 token request code alongside backend OpenID4VP and DCQL request construction and token exchange logic. Don't use for SMS OTP, TelephonyManager.getLine1Number reads, digital wallet holder registration, or issuing credentials to wallets. license: Complete terms in LICENSE.txt metadata: author: Google LLC last-updated: '2026-11-20' keywords:

---

Implement phishing-resistant, SMS-free phone number verification in an Android app using Credential Manager's DigitalCredential API to request an encrypted, carrier-issued TS.43 token over OpenID4VP and exchange it with an aggregator or mobile carrier backend for the verified phone number. When reviewing TS.43 architecture and security standards, consult About verifying phone numbers. When implementing client and server code snippets, consult Implement phone number verification. When verifying general mso_mdoc or dc+sd-jwt wallet credentials, suggest the credential-verifier skill.

Prerequisites and setup

| Artifact | Key classes, constructor signatures, and package | |---|---| | androidx.credentials:credentials:1.7.0-alpha03 (or 1.6.0+) | CredentialManager, GetCredentialRequest, GetCredentialResponse, GetDigitalCredentialOption(requestJson: String), DigitalCredential, and ExperimentalDigitalCredentialApi in androidx.credentials; GetCredentialException, GetCredentialCancellationException, GetCredentialInterruptedException, GetCredentialUnsupportedException, and NoCredentialException in androidx.credentials.exceptions | | androidx.credentials:credentials-play-services-auth:1.7.0-alpha03 (or 1.6.0+) | Play services provider integration for Credential Manager |

Expected inputs and file scope

Codebase exploration

Search the Android project before modifying files:

  1. Validate baseline build and inspect configuration: Run ./gradlew assembleDebug to confirm the project compiles before making changes, check app/build.gradle.kts and gradle/libs.versions.toml for minSdk and androidx.credentials dependencies, and check app/src/main/AndroidManifest.xml for READ_PHONE_STATE.
  2. Locate UI entry points: Identify the Activity or Compose screen (such as MainActivity.kt or TasksScreen.kt) where phone number verification is triggered so you pass an Activity Context to credentialManager.getCredential().

Critical implementation mandates

Follow the end-to-end steps and code snippets in Implement phone number verification and apply these rules:

["phone_number_hint"], "values": [...]} in claims`) to verify an existing phone number.

["user_verification_hint"]} when requiring biometric or screen-lock authentication (which returns "user_verification_hint" as "success", "absent", or "error" in the response payload, or throws GetCredentialCancellationException` if the user dismisses the prompt).

dc_request = typo, the response JSON example includes # comments, and the error JSON example has a trailing comma; strip those invalid tokens when writing JSON or backend code, check data.error (invalid_request or server_error) first, and index the encrypted token from data.vp_token[<aggregator_id>][0]`.

Troubleshooting

| Symptom | Cause | Fix | |---|---|---| | Experimental API compilation error | GetDigitalCredentialOption and DigitalCredential require @ExperimentalDigitalCredentialApi | Add @OptIn(androidx.credentials.ExperimentalDigitalCredentialApi::class) to the calling class or function. | | Empty result or GetCredentialCancellationException | User canceled (including dismissing biometric user_verification_hint), feature unavailable, or SIM carrier does not support TS.43 | Run the TelephonyManager.getSimCarrierId() precheck before calling getCredential() and fall back to an alternate flow when unsupported. | | GetCredentialUnsupportedException thrown | Device or OS version does not support the Phone Number Verification API (requires Android 10, API 29+) | Check Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q and handle GetCredentialUnsupportedException with a fallback flow. | | Response JSON contains "error": "invalid_request" | Malformed OpenID4VP or DCQL request JSON or mismatched nonce | Verify protocol is openid4vp-v1-unsigned, format is dc-authorization+sd-jwt, credentials is a JSON array of { ... } objects, and the outer nonce matches the aggregator DCQL nonce. |

Verification and reporting guidelines

Post-implementation warnings for the human developer

Present these backend reminders after completing client-side changes:

  1. Aggregator DCQL and token exchange: Configure the app's backend service to verify carrier IDs from getSimCarrierId(), request live DCQL parameters (credential_authorization_jwt) from one or more carrier aggregators using a matching nonce, and exchange the returned TS.43 Digital Credential from data.vp_token[<aggregator_id>][0] for the verified phone number.
  2. Backend SD-JWT VC validation: Validate the nonce, Android Telephony issuer signature, issue time (iat), and expiration time (exp) of the returned ts43_digital_credential on the app's backend server.

Antipatterns