Skip to main content

Didit Authentication Redirects for iOS and Android Native Apps

Didit returns native app users through an HTTPS redirect only; custom URL schemes are refused. Register the redirect in Authentication > Security and sessions, then verify the domain on iOS or Android.

Didit Authentication Redirects for iOS and Android Native Apps

Contents

In this guide

Jump to the part you need.

Native iOS and Android apps can use Didit Authentication, but only through an HTTPS redirect, never a custom URL scheme. You register the redirect under Authentication > Security and sessions, prove the host belongs to your app with an iOS associated domain or an Android App Link, and register passkeys with PUT native-apps/. The first 50,000 authentication active users each month are free, then $0.02 per active user.

Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.

Didit Authentication redirect setup for native apps at a glance
ItemWhat it requires
Redirect type we acceptHTTPS only, for example https://app.example.com/didit/callback. Custom URL schemes are not accepted.
Where to register itAuthentication > Security and sessions in the Didit Business Console. Publishable key from Authentication > Developers.
iOS requirementAssociated Domains entry webcredentials:app.example.com plus https://app.example.com/.well-known/apple-app-site-association listing your TEAMID.bundle.id under webcredentials.
Android requirementAn App Link: https://app.example.com/.well-known/assetlinks.json with delegate_permission/common.handle_all_urls for your package and signing certificate, and the SDK redirect activity in the manifest.
PasskeysPUT native-apps/ on the Authentication management API with your app ID or package and SHA-256 fingerprints. iOS also adds webcredentials:<your application's Didit host>.
SDK versionsiOS DiditAuth 4.15.4 (iOS 15, hosted pages need iOS 17.4). Android me.didit:didit-auth:4.15.4 (passkeys need Android 9).
PriceAuthentication active users: first 50,000 each month free, then $0.02 per active user a month. Verification and step-up checks are billed separately, for example a full ID check at $0.33. Sandbox testing is free.

Start free in the sandbox at business.didit.me (no sales call). The product page is Didit Authentication and every unit price is on didit.me/pricing. If you would rather have an AI assistant make the management API calls, connect Didit at didit.me/developers/mcp.

Why custom URL schemes do not work here

Didit returns people to your app through an HTTPS redirect only. Custom URL schemes are not accepted. The return path is an HTTPS URL on a host your app claims on the device, through an associated domain on iOS or an App Link on Android.

One practical consequence: the redirect URL you register in the console and the host you verify on the device must match. If you register https://app.example.com/didit/callback, the well-known files must be served from app.example.com and your intent filter or associated domain must name the same host and path.

Prerequisites

What you need before you start
RequirementDetail
PlanThe sandbox is free on every plan, and every Sandbox application has Authentication turned on from the start. A Live application turns Authentication on from the Products page of the console.
Console accessReading the Authentication section needs the authentication permission at read, changing it needs write. See roles and permissions.
API credentialAn API key of the application with the authentication scope, or an owner-approved grant carrying didit:management. A full-access key that includes the primary secret already covers Authentication.
ClientiOS: Swift Package https://github.com/didit-protocol/sdk-ios.git at 4.15.4, product DiditAuth. Android: me.didit:didit-auth:4.15.4 from the Didit Maven repository.
DomainAn HTTPS host you control, able to serve two static files under /.well-known/ and to serve the callback path.
DevicesTest on a real device. The iOS simulator does not always validate associated domains.

iOS and Android side by side

The same redirect, configured differently on each platform
What you configureiOSAndroid
ConsoleAuthentication > Security and sessions for the redirect URL, Authentication > Developers for the publishable key.Authentication > Security and sessions for the redirect URL, Authentication > Developers for the publishable key.
File on your host/.well-known/apple-app-site-association, listing TEAMID.bundle.id under webcredentials./.well-known/assetlinks.json, with the delegate_permission/common.handle_all_urls relation for your package and signing certificate.
App declarationAssociated Domains entitlement with webcredentials:app.example.com.<activity android:name="me.didit.sdk.auth.DiditAuthRedirectActivity"> with an autoVerify intent filter in AndroidManifest.xml.
Passkey registrationPUT native-apps/ with the app ID TEAMID.bundle.id, plus webcredentials:<your application's Didit host> in Associated Domains.PUT native-apps/ with the package name and its SHA-256 signing-certificate fingerprints.
SDKDiditAuth 4.15.4, iOS 15; hosted pages need iOS 17.4.me.didit:didit-auth:4.15.4; passkeys need Android 9 or later.
Where the session livesThe Keychain, this device only.Storage protected by the Android Keystore.

Setup, step by step

Step 1: Work in a Sandbox application first

Authentication is new. Set a method up in a sandbox application first, then in your live application. A Sandbox application has Authentication on from the start and includes every plan's features, so you can prove the redirect before you touch production. When you are ready, open the Live application, go to the Products page and turn Authentication on. Keep the sandbox and live applications, their keys and their redirect URLs separate at every step.

Step 2: Register the redirect URL in the console

In the console, under Authentication > Security and sessions, add your redirect URL, for example https://app.example.com/didit/callback. Then copy the publishable key from Authentication > Developers. That key is public and belongs in the app. No Didit API key and no secret ever belongs in your app: the code exchange is protected by PKCE instead of a client secret.

If you built your own sign-in screens instead of using the hosted pages, set sign_in_ui to own and add your web origin under Allowed origins as well. Passkeys belong to your application's sign-in origin, so an app on another domain sends people to the hosted page for passkeys.

Step 3: Add the iOS associated domain

Add the redirect's host to your app's Associated Domains as webcredentials:app.example.com, and serve https://app.example.com/.well-known/apple-app-site-association listing your app (TEAMID.bundle.id) under webcredentials. iOS checks both the entitlement and the file before it opens the page. If the file is missing, unreachable over HTTPS, or does not name the same host as the redirect, the sign-in finishes in the browser and never comes back to your app.

Step 4: Make the redirect an Android App Link

Make https://app.example.com/didit/callback an App Link of your app: publish https://app.example.com/.well-known/assetlinks.json with the delegate_permission/common.handle_all_urls relation for your package name and signing certificate. Then declare the SDK's redirect activity with that App Link in AndroidManifest.xml. tools:node="replace" replaces the library's unexported declaration, so add xmlns:tools="http://schemas.android.com/tools" to the root <manifest> element if it is not there.

<activity
    android:name="me.didit.sdk.auth.DiditAuthRedirectActivity"
    android:exported="true"
    android:theme="@android:style/Theme.Translucent.NoTitleBar"
    tools:node="replace">
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="https" android:host="app.example.com" android:path="/didit/callback" />
    </intent-filter>
</activity>

Step 5: Register the native app so passkeys can work

Passkeys need one more registration, and the identifier is different on each platform. On iOS it is your app ID, TEAMID.bundle.id. On Android it is your package name together with its SHA-256 signing-certificate fingerprints. Register it with PUT native-apps/ on the Authentication management API. On iOS, also add webcredentials:<your application's Didit host> to your Associated Domains, because the passkey ceremony runs on the Didit sign-in origin. A redirect URL on that same Didit host also satisfies the associated domain check.

The call goes to your application's management base:

https://apx.didit.me/auth/v2/organizations/{org_id}/applications/{application_id}/authentication/
curl --fail-with-body --request PUT "${MANAGEMENT_BASE}native-apps/" \
  -H "x-api-key: $DIDIT_API_KEY" \
  -H "Content-Type: application/json"

See Set up Didit Authentication by API for the route, the credential types and the contract behind the example above. The request body is deliberate: it must follow the OpenAPI contract in openapi-auth.json under the Setup tag, which is where the exact field names and types for the app ID, package name and certificate fingerprints are defined. The server SDKs generate the same route as the authentication_setup resource. Read that contract before you send the call, and send the identifier for the platform you are registering.

Passkeys need Android 9 or later. On iOS the hosted pages need 17.4, while signInWithPasskey still works below that.

Use Didit with MCP, showing an AI assistant connected to the Didit MCP server
An agent connected over MCP can make the native-apps/ registration for you, using the owner-approved didit:management grant.

Step 6: Install the SDK and start sign-in

Add the Swift Package at 4.15.4 and the DiditAuth product to your iOS target, or add me.didit:didit-auth:4.15.4 next to the Android verification SDK. One instance per application. The SDK opens your hosted Didit page, keeps the PKCE verifier and state, and holds the session in the Keychain on iOS or in storage protected by the Android Keystore.

import DiditAuth

let auth = try DiditAuth(publishableKey: "pk_live_...", redirectUri: "https://app.example.com/didit/callback")

let session = try await auth.signIn(from: viewController)                    // hosted page: sign-up and sign-in
let passkeySession = try await auth.signInWithPasskey(from: viewController)  // alternative: a passkey of this device
let token = try await auth.getToken()  // five-minute JWT for your backend
import me.didit.sdk.auth.*

val auth = DiditAuth(applicationContext, publishableKey = "pk_live_...", redirectUri = "https://app.example.com/didit/callback")

val session = auth.signIn(activity)                     // hosted page: sign-up and sign-in
val passkeySession = auth.signInWithPasskey(activity)  // alternative: a passkey of this device
auth.getToken()  // String?: a five-minute JWT for your backend, renewed before it expires

If you install a DiditSDK verification variant instead, it already includes DiditAuth and you keep import DiditSDK. Install one or the other, not both.

A walkthrough of the verification screens an end user sees during a Didit check
What the person sees on the hosted page after your app hands off to Didit. The redirect brings the result back to your callback URL.

Step 7: Verify the token on your backend

Send getToken() to your backend as a Bearer token and verify it there, against the issuer's JWKS at <origin>/.well-known/jwks.json, before you trust it. Check the ES256 signature, then iss, aud, exp and typ: at+jwt, and reject a token whose act is not null unless the route accepts AI agents. An access token stays valid for 5 minutes, so call getToken() right before each request.

Before a sensitive action, check the live session with GET /session/. It fails at once when the session was revoked, went idle or expired, when the person was blocked, or when the session no longer meets your MFA policy. Full detail is in tokens and JWKS.

What comes back on the redirect

Mapping the redirect, the session and the webhooks to what your app does
Field or eventWhere it comes fromWhat to do with it
code and stateThe redirect to your callback URLExchange the code at POST /token/ within 60 seconds using the PKCE verifier, and refuse a redirect whose state does not match the sign-in you started.
Access tokenThe token endpointA five-minute JWT. Send it as Authorization: Bearer and verify it against the JWKS before trusting it.
userIdDiditSessionYour stable person identifier across sessions.
sessionIdDiditSessionThe session identifier returned in the session object.
applicationIdDiditSessionIdentifies the application associated with the session.
vendorDataDiditSessionThe id that ties the person to their verifications and transactions across products.
email, emailVerified, phoneDiditSessionContact state you can gate features on.
methods, mfaVerified, verified, organizationsDiditSessionPolicy inputs: how the person signed in, whether MFA and verification are done, which organizations they belong to.
expiresAtDiditSessionWhen the session ends, under your rule "Sessions last X, or Y without activity".
auth.signup, auth.login, auth.new_deviceWebhooks to your endpointServer-side record of a new account, a sign-in and a new device, independent of what the app reports.

Test in the sandbox

Run against a Sandbox application with sandbox users. Sandbox applications can use Didit's own test apps for Google, Microsoft, Apple and GitHub (credential_source: "didit_test"), which is enough to finish a setup and prove it works without your own OAuth client. On a device, sign in, watch the hosted page close, and confirm your callback URL receives a code and the same state your app started with.

Expected success: the app opens the hosted page, the person signs in, the browser closes, signIn returns a DiditSession with a userId and sessionId, and getToken() returns a JWT your backend accepts against the JWKS.

Common failures and fixes
What you seeCauseFix
The redirect opens in the browser and never returns to the appThe associated domain or App Link is not verifiedServe apple-app-site-association or assetlinks.json over HTTPS at the well-known path, confirm the host and path match the registered redirect exactly, and test on a real device.
A redirect arrives with a different sign-inThe PKCE verifier and state belong to another sign-inStart sign-in from the same app instance and let the SDK hold the verifier and state. The SDK refuses a redirect for any other sign-in.
cancelledThe person closed the hosted page or the Custom TabTreat it as a no-op and leave them signed out.
browser_unavailable on iOSThe hosted pages need iOS 17.4Raise the deployment target for sign-in and step-up, or use signInWithPasskey, which still works below 17.4.
A passkey sign-in does not complete on the deviceThe documented requirement is not met for that platformRegister the iOS app ID or the Android package name with its SHA-256 fingerprints using PUT native-apps/, and on iOS add webcredentials:<your application's Didit host> to Associated Domains.
401 or 403 on the management APINo credential, a scoped key without authentication, a key of another application, or a grant for another organizationUse a full-access key of that application or a key with the authentication scope at write, and check the key's IP allowlist and expiry.
The session reads as signed out on Android after a restoreA backup restored on another device cannot be decryptedExpected. The person signs in again on the new device.
step_up_user_mismatchA different person signed in during reauthenticateThe new session is ended and the current one stays. Ask the original person to finish the step-up.
Biometric Authentication by Didit, showing the biometric step used before a sensitive action
Step-up before a payout or a contact change reuses the same redirect and follows your step-up rules.

Disconnecting and rolling back

To stop using Didit Authentication on this app, remove the redirect URL under Authentication > Security and sessions, then sign people out from the console: Revoke sessions on a person signs them out everywhere, agents included, and Revoke under Sign-ins > Active sessions ends a single device. Blocking a person also ends their sessions and agent access.

What the setup costs at both ends

Cost of the native app redirect setup
ItemWho paysAmount
Redirect domain and well-known filesYouYour own hosting cost. Static files on a host you already run.
iOS associated domains, Android App LinksYouNo platform fee. The SDKs and the MCP server are free.
Authentication active usersYou, to DiditFirst 50,000 each month free, then $0.02 per active user a month. This line is separate from verification charges.
Verification at sign-up, if you require oneYou, to DiditFull ID check $0.33 per completed check, billed as its own line.
SandboxYouFree and unlimited on every plan.

Worked example at list price: a native app with 60,000 authentication active users in a month, where 12,000 of them complete a full ID check at sign-up. The active-user line and the verification line are billed separately.

  • Active users: 60,000 minus the 50,000 free allowance = 10,000 billable. 10,000 x $0.02 = $200.00.
  • Full ID check: $0.15 ID document + $0.10 passive liveness + $0.05 face match 1:1 + $0.03 device and IP = $0.33. 12,000 x $0.33 = $3,960.00.
  • Month total: $200.00 + $3,960.00 = $4,160.00.

On Scale, which takes 10% off Didit prices, the same ID checks cost 12,000 x $0.297 = $3,564.00. Run your own volumes against the price feed before you commit to a number.

Sources

Next step: create a free Sandbox application at business.didit.me, register the HTTPS redirect, and prove the loop on a real device. No sales call, and the sandbox is free on every plan.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alberto Rosas

Co-founder and CEO

Alberto Rosas

Alberto Rosas

Co-founder and CEO

About Didit

Questions

Frequently asked questions

Can a Didit Authentication redirect use a custom URL scheme like myapp://callback?

No. Didit returns people to your app through an HTTPS redirect only, and custom URL schemes are not accepted. You register an HTTPS URL such as https://app.example.com/didit/callback under Authentication > Security and sessions, then prove on the device that the host belongs to your app with an associated domain on iOS or an App Link on Android.

What file does iOS need for a Didit Authentication redirect?

Serve https://app.example.com/.well-known/apple-app-site-association listing your app as TEAMID.bundle.id under webcredentials, and add webcredentials:app.example.com to your app's Associated Domains. iOS checks both the entitlement and the file before it opens the hosted page, so a missing or mismatched file leaves the sign-in in the browser.

What does assetlinks.json need for Android?

Publish https://app.example.com/.well-known/assetlinks.json with the delegate_permission/common.handle_all_urls relation for your package name and signing certificate. Then declare me.didit.sdk.auth.DiditAuthRedirectActivity in AndroidManifest.xml with an autoVerify intent filter for the same scheme, host and path, using tools:node="replace".

Do I have to register my app twice to get passkeys working?

Yes, there are two registrations. The redirect URL goes in the console under Authentication > Security and sessions, and the app itself goes to PUT native-apps/ on the Authentication management API. On iOS you send the app ID TEAMID.bundle.id and also add webcredentials:<your application's Didit host> to Associated Domains. On Android you send the package name with its SHA-256 signing-certificate fingerprints.

Which OS versions do the Didit native authentication SDKs need?

The iOS DiditAuth module needs iOS 15, and the hosted sign-in and step-up pages need iOS 17.4, below which those calls throw browser_unavailable. The Android library is me.didit:didit-auth:4.15.4, and passkeys need Android 9 or later. Both ship in the native SDKs since version 4.11.0.

Why does the redirect work in a browser but not inside my app?

The console setting is only half of the claim. The device also checks that your app owns the redirect host, through the associated domain on iOS or the verified App Link on Android. If the well-known file is missing, served over HTTP, names a different host, or you tested on the iOS simulator, the URL stays in the browser and never reaches your callback.

How much does Didit Authentication cost for a native app?

The first 50,000 authentication active users each month are free, then $0.02 per active user a month. Verification and step-up checks are billed separately at their published prices, for example a full ID check at $0.33. Sandbox testing is free and unlimited.

Can I reuse the same redirect URL in sandbox and live?

You can use the same host and path, but keep the applications, keys and redirect settings separate. Settings belong to the application selected at the top of the console, and live and sandbox applications have separate settings and people. Mixing them is the usual reason a production build lands in a sandbox session.

How do I verify the session after the redirect on my backend?

Send getToken() as a Bearer token and verify the ES256 signature against <origin>/.well-known/jwks.json, then check iss, aud, exp and typ: at+jwt. Before a sensitive action, call GET /session/ to confirm the session is still live. Never decide permissions from the app alone.

What happens if the person closes the sign-in page?

The SDK throws cancelled and the person stays signed out. Treat it as a no-op in your UI. A redirect that arrives for a different sign-in is refused by the SDK, because the hosted sign-in is bound to its start with PKCE (S256) and a random state.

Can an AI assistant make the native app registration for me?

Yes. Connect Didit to your assistant at didit.me/developers/mcp and approve the didit:management grant on the consent screen. The agent then calls the Authentication management API, including PUT native-apps/, under the limits you approved.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.