Skip to main content

Auth0 Post-Login Action with Didit IDV: Step-by-Step

Didit runs as an OpenID Connect bridge for Auth0 post-login Actions, requiring a Didit check after Auth0 authenticates the user. PAR only, PKCE S256, a 5-minute single-use code, and FAILED when a review is open.

Auth0 Post-Login Action with Didit IDV: Step-by-Step

Contents

In this guide

Jump to the part you need.

This guide is for teams on Auth0 that want a Didit identity check inside a post-login Action: the check runs after Auth0 authenticates the user and before the login completes. The Okta and Auth0 profile pushes every request through PAR and returns verified claims in the ID token. A workflow that runs a full KYC check costs $0.33 per completed check at list price. The caveat: if a review reverses an approval before redemption, the token returns FAILED.

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

Didit in an Auth0 post-login Action at a glance
ItemWhat it is
Didit profileOkta and Auth0 profile, the delegated contract Okta Identity Engine uses for bring-your-own identity verification vendors
Authorization requestPushed Authorization Request only (PAR, RFC 9126)
PKCERequired, method S256
Base URLhttps://apx.didit.me/auth/idv, the same for production and sandbox
User window15 minutes from the authorization request to finish the verification
Authorization codeValid for 5 minutes once issued, single use
ID token resultverified_claims with trust_framework IDV-DELEGATED and assurance_level VERIFIED or FAILED
Price$0.33 per completed full KYC check at list price, $0.3168 on Growth, $0.297 on Scale

Start free in the sandbox at https://business.didit.me/, no sales call needed, and run the whole flow against simulated outcomes before you spend anything. If you build with an AI assistant, connect Didit to it through the Didit MCP server.

What this integration actually does

We run an OpenID Connect authorization server that performs a verification whenever your identity platform asks for one, then returns the verified identity in a signed ID token. Teams use the post-login Action to require a Didit identity verification check after Auth0 authenticates the user and before the login completes. The Action does not replace the initial login. The recommended method is this documented bridge, not a session you build and poll yourself, because the bridge already handles the claim comparison, the signed token and the review wait.

The bridge also speaks a plain OpenID Connect profile for identity brokers and relying parties such as Keycloak. This guide uses the Okta and Auth0 profile for the post-login Action. That profile requires PAR and PKCE with S256 and compares given_name and family_name fuzzily. For a completed verification that is not approved, Didit returns an authorization code to the registered callback. Redeeming that code returns an ID token with assurance_level set to FAILED.

One consequence is worth repeating to your product team: a FAILED result is not an OAuth error. The token request succeeds. The Action has to read the assurance level and decide whether the person gets in.

The hosted Didit verification screens a user sees after the post-login Action redirects them
What the person sees after the Action redirects them: a hosted Didit flow, then a return to your registered redirect URI.

The handoff at a glance

What the Action sends, where the browser goes, and when the access decision is made
WhoWhat happens
Action, server sidePushes the authorization request to POST {base}/par with the PKCE challenge, state, nonce, the registered redirect_uri, the scopes and the claims. We return a single-use request_uri valid for 60 seconds.
BrowserGoes to GET {base}/authorize?request_uri=.... No Didit secret ever reaches it.
DiditCreates the verification session and runs the hosted flow for the user.
Your registered callbackReceives a one-time code and the original state from us, and must carry both into the Action continuation that started this login attempt.
Action, server side againCompares the returned state, then redeems the code at POST {base}/token with the original code_verifier.
Access decisionMade after full ID token validation and the assurance check, never before.

The endpoints you will call

Documented endpoints, all under the bridge base URL
PurposeEndpoint
Pushed Authorization RequestPOST {base}/par
AuthorizationGET {base}/authorize
TokenPOST {base}/token
UserInfoGET or POST {base}/userinfo
JWKSGET {base}/jwks
DiscoveryGET {base}/.well-known/openid-configuration

Client authentication uses client_secret_basic or client_secret_post. The discovery document at {base}/.well-known/openid-configuration advertises every endpoint above.

Prerequisites

  • A Didit account with an application and a KYC workflow. Every application comes as Live and Sandbox; see Applications in the Didit Console.
  • Client credentials for the integration: a client_id and a dedicated client secret that we issue when we enable the profile for your client. We show the secret once, when it is issued.
  • The exact redirect URI you will register, character for character. A trailing slash, an extra path segment or a query string makes it a different URI.
  • An Auth0 tenant with Actions enabled, a post-login Action, and Action secrets where the client secret can live.
  • A way to correlate the callback with the original login attempt. The state, the nonce and the PKCE code_verifier must remain available securely through that attempt; how you keep them is your design decision.

The integration in eight steps

These steps describe the Didit bridge contract. Where a step needs glue on the Auth0 side, such as the callback route and the continuation that hands code and state to the Action, the Didit documentation does not prescribe the wiring, so read them as the contract your Action must satisfy rather than a deployable Action you can paste.

Step 1. Create the workflow and pick the environment

Build a KYC workflow in the Didit Console and test it in Sandbox first. Production and sandbox use the same endpoints, so the credentials decide which environment a request lands in. Keep one set of credentials per environment, tied to a workflow that belongs to the matching application. Sandbox testing is free on every plan.

Step 2. Register the redirect URI exactly

Register the exact URI that will receive our redirect as a redirect URI for the Didit client. The redirect_uri of every request must be exactly one of the registered URIs: a trailing slash, an extra path segment or a query string makes it a different URI and the request is rejected. In this guide the value is written as https://YOUR_AUTH0_DOMAIN/YOUR_REGISTERED_CALLBACK, a placeholder for your own registered URI, not a working Auth0 path.

Step 3. Store the dedicated client secret

We issue a dedicated client secret when we enable the integration and show it once, at that point. Store it in your identity platform's secret store: it authenticates your client at the PAR and token endpoints and has no other use. The application's API keys are not accepted as the client secret of an integration that has its own secret. We can rotate the secret on request, and the replaced secret keeps working for a grace period of 24 hours unless you ask for another one, so you can switch without downtime.

Integrations set up before dedicated secrets existed authenticate with the application's Primary API key. They keep working until we issue them a dedicated secret; from then on only the new secret is accepted.

Step 4. Generate state, nonce and the PKCE challenge

Create a state, a nonce and a PKCE verifier for each login attempt, and derive the code_challenge with method S256. Do this immediately before the push: the request_uri that PAR returns is valid for 60 seconds and can be used once. Because the callback has to be correlated with the original login attempt, the original nonce and the PKCE code_verifier must stay available securely through that attempt and be read back when the code returns.

Step 5. Push the authorization request to PAR

Push the request from the first execution of the post-login Action, server side, with the documented inputs: the registered redirect_uri, the scopes openid profile identity_assurance, state, nonce, code_challenge with code_challenge_method=S256, and the claims parameter. Authenticate with client_secret_basic or client_secret_post. The response carries a single-use request_uri valid for 60 seconds.

Send the claims to compare inside the standard OpenID Connect claims parameter, as a verified_claims array:

{
  "id_token": {
    "verified_claims": [
      {
        "verification": {
          "trust_framework": { "value": "IDV-DELEGATED" },
          "assurance_level": { "value": "VERIFIED" }
        },
        "claims": {
          "given_name": { "value": "Lucas", "fuzzy": true },
          "family_name": { "value": "Fraggioli", "fuzzy": true }
        }
      }
    ]
  }
}

Step 6. Send the browser to the authorization endpoint

Redirect the user's browser to the authorization endpoint with the request_uri. We create the verification session and send the person into the hosted flow. The user has 15 minutes from the authorization request to complete verification.

GET https://apx.didit.me/auth/idv/authorize?request_uri=REQUEST_URI

Step 7. Receive the code and state at your callback

When the user finishes, we evaluate the decision, compare the extracted identity against the claims that were pushed, and return the browser to your registered redirect_uri with a one-time code and the original state. Your side receives that redirect, not the Action directly, so the callback you registered has to carry the code and state into the Action continuation that started this login attempt. The Didit documentation does not define an Auth0 callback path or a continuation mechanism, so that route is yours to build. Before anything is redeemed, compare the returned state with the value stored for the original Didit request and stop if they differ. For a completed verification that is not approved, Didit returns an authorization code to the registered callback. Redeeming that code returns an ID token with assurance_level set to FAILED. If the verification times out and your callback has no valid authorization code, stop the login attempt and start a fresh authorization request.

Step 8. Redeem the code and validate the ID token

Authenticate the client at POST {base}/token and exchange the authorization code with its original code_verifier. The code is valid for 5 minutes once it is issued and can be used once, so an expired or already redeemed code fails. Then validate the ID token in full before you read anything from it: the RS256 signature against the JWKS endpoint, the issuer and audience against your expected values, the expiry, and the original nonce. Only after that check do you read the assurance level. Issue the session only when the validated token reports VERIFIED. The access token returned alongside it is valid for one hour and is accepted only by the UserInfo endpoint, in an Authorization: Bearer header or an access_token form field on a POST.

A Didit session detail showing the identity document extracted for a verification
A session detail in the Didit Business Console showing extracted document data.

Expected output

On an approved check, the ID token carries a verified_claims array. Each entry holds a verification object whose trust_framework is IDV-DELEGATED and whose assurance_level is VERIFIED, plus the compared claims, which on this profile are given_name and family_name. For a completed verification that is not approved, Didit returns an authorization code to the registered callback, and redeeming that code returns an ID token with assurance_level set to FAILED.

The Action must block login unless the validated ID token reports VERIFIED. Write that as a hard branch: read the assurance level from the token you validated in step 8, and when it is not VERIFIED, do not issue the session. Show a neutral message with the support or retry option appropriate to the case, and log your own login-attempt reference and the outcome for support. Do not tell the person why the check failed, and do not frame it as a wrong password, because a failure can come from fraud checks or an open review as easily as from a bad document.

Keep three failure shapes apart, in your logging and in what the user sees:

  • A verification outcome carried by a valid ID token, where assurance_level is FAILED. The login is blocked and the person gets the neutral message plus the retry or support route you chose.
  • A callback problem: no code arrives, the state does not match, or the user never finished inside the 15-minute window. If the verification times out and your callback has no valid authorization code, stop the login attempt and start a fresh authorization request.
  • A token exchange or token validation failure: the code is expired, already redeemed or paired with the wrong verifier, or a signature, issuer, audience, expiry or nonce check fails. Treat these as exchange or validation failures. Start a fresh attempt after expiry and investigate repeated validation failures. Log it, alert on it, and do not show a verification failure message.

Sandbox acceptance checklist

Run these four before launch. The sandbox is free on every plan. Both environments use the same endpoints. Use the client credentials and workflow for the environment you are testing.

Four cases to accept in the sandbox, with the expected outcome
CaseHow to produce itExpected outcome
Approved verificationComplete a simulated pass in the sandbox flowA code returns, the exchange succeeds, the validated ID token reports VERIFIED, and the Action issues the session
Session still in review when the code is redeemedComplete a simulated case that stays under reviewThe code returns and the ID token reports FAILED; the Action blocks the login
Approval changed before redemptionTake an approved session and let a later fraud review move it to a failing decision before you redeemThe ID token reports FAILED; the Action blocks the login
Expired or already redeemed codeHold the code past its 5 minute lifetime, or redeem it a second timeAn expired code cannot complete the login. A second redemption is rejected and cannot complete another login

Inputs and outputs

What you send and what you get back
FieldWhereWhat it does
redirect_uriInputMust match a registered URI exactly
stateInput and outputReturned unchanged with the code; compare it before redeeming to match the resumed login
nonceInputBinds the ID token to this login attempt and is checked during validation
code_challenge, code_challenge_methodInputPKCE, S256 is required on this profile
scopeInputopenid profile identity_assurance
claimsInputThe verified_claims array with given_name and family_name to compare
request_uriOutputSingle use, valid 60 seconds, handed to the authorization endpoint
codeOutputSingle use, valid 5 minutes once issued, exchanged with the verifier
ID tokenOutputRS256, carries verified_claims and the assurance level
access_tokenOutputValid one hour, accepted only by UserInfo

Failure cases and recovery

What breaks and what to do
SymptomCauseRecovery
PAR rejectedRedirect URI differs by a slash, a path or a query stringCopy the registered URI byte for byte into the request
PAR rejectedPKCE missing on a profile that requires itSend code_challenge with method S256 on every request
User lands on an error instead of the flowrequest_uri older than 60 seconds or already usedPush a fresh authorization request from the Action
Code exchange failsCode expired, already redeemed, or verifier mismatchStart a new authorization request; never retry an old code
The verification exceeds the documented 15-minute windowThe user did not finish in timeIf your callback has no valid authorization code, stop the login attempt and start a fresh authorization request
Login blocked after a clean checkA later fraud review moved the session to a failing decision; the decision is re-read at code redemptionExpected behaviour. Read the session in the Console and log the case before you retry
Client authentication failure at the PAR or token endpointWrong secret, or the authentication method you configured does not match the one you sendCheck the dedicated client secret for this integration and the authentication method you configured, then retry

The verification decision is re-read when the code is redeemed, so the verdict the Action sees is the verdict at redemption time, not the one shown at the end of the hosted flow. A session that was approved and then flagged by a later fraud review returns FAILED. Build the Action so a FAILED result is a normal branch with logging, not an exception.

A Didit session overview listing the warnings that pushed a verification into manual review
Warnings that push a session into review are listed on the session overview in the Didit Business Console.

What you pay and where review boundaries sit

You pay per completed check from prepaid credit. Because the bridge creates a real verification session, the session lines apply, not the standalone API lines. A full KYC check is $0.33 and it is three parts in one check: ID document verification $0.15, biometrics at $0.10 passive liveness plus $0.05 face match 1:1, and device and IP analysis $0.03. Add AML screening at $0.20 if your workflow screens the person, face search 1:N at $0.05 per search, and proof of address at $0.20 when you collect it. The Didit pricing page carries every line and the cost estimator.

  • Free: the first organization created with an eligible work email gets $10 in monthly Free plan credit. The sandbox is free on every plan.
  • Growth: $99 a month, $115 of credit a month, 4% off every Didit price.
  • Scale: $299 a month, $350 of credit a month, 10% off every Didit price.

Plan credit offsets usage. It does not pay the subscription fee, and unused monthly credit does not roll over.

We can hold the user on a review page for a configured time. If the session is still in review when the code is redeemed, the ID token reports FAILED. If a later fraud review changes an approval to a failing decision before redemption, the token also returns FAILED. Agree that window before launch: a long hold keeps a real person waiting on a Didit page, and a short one sends them back to your login with FAILED. The statuses that drive all of this are documented under verification statuses, and the reviewer side under manual KYC review.

Worked cost example

Suppose 5,000 logins a month reach the Action and each one completes a full KYC check with no AML step.

Per check at list price: $0.15 + $0.10 + $0.05 + $0.03 = $0.33. At 5,000 checks: 5,000 x $0.33 = $1,650.00 a month.

On Growth the same check is $0.3168: 5,000 x $0.3168 = $1,584.00 of usage. After the $115 of monthly plan credit, $1,469.00 of usage remains. Add the $99 monthly fee for a total of $1,568.00 a month.

On Scale the check is $0.297: 5,000 x $0.297 = $1,485.00 of usage. After the $350 of monthly plan credit, $1,135.00 of usage remains. Add the $299 monthly fee for a total of $1,434.00 a month.

Add AML screening and the list price version becomes 5,000 x ($0.33 + $0.20) = 5,000 x $0.53 = $2,650.00 a month. Sandbox runs cost nothing, so the whole integration can be built and regression tested before the first billed check.

Sources

Open the sandbox at https://business.didit.me/, create an application with a KYC workflow, and run one login through the whole eight-step path against simulated outcomes. No sales call is needed, and nothing in the sandbox is billed.

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

What is the Didit integration for Auth0 post-login Actions?

It is an OpenID Connect authorization server that performs a Didit verification when an Auth0 post-login Action asks for one, then returns the result as an ID token with a verified_claims array. Teams use it to require a Didit identity check after Auth0 authenticates the user and before the login completes; it does not replace the initial login. The trust framework is IDV-DELEGATED and the assurance level is VERIFIED or FAILED, and the base URL is https://apx.didit.me/auth/idv for both production and sandbox.

Is PAR mandatory for the Auth0 profile?

Yes. The Okta and Auth0 profile accepts only a Pushed Authorization Request, and PKCE with S256 is required. The request_uri that PAR returns is single use and valid for 60 seconds. The plain authorization request option belongs to the separate OpenID Connect profile, which this guide does not use.

How long does a user have to finish the Didit verification?

The user has 15 minutes from the authorization request to finish the verification. The authorization code is valid for 5 minutes once it is issued and can be redeemed once. If either window closes, start a new authorization request instead of retrying the old one.

Why does a user who passed the hosted flow come back with a FAILED assurance level?

The verification decision is re-read when the code is redeemed, so the verdict at redemption is what your Action receives. A session that is still in review at that moment returns FAILED, and so does an approval that a later fraud review moves to a failing decision before redemption. Log the case and read the session detail in the Console before you retry.

Can Didit hold the user while a reviewer looks at the session?

Yes. We can hold the person on a review page for a configured time to give a reviewer a chance to decide. If the session is still in review when the code is redeemed, the profile returns FAILED, and a later fraud review that changes an approval to a failing decision before redemption also returns FAILED. Treat the window as a product decision to agree before launch.

How much does each verification cost in this flow?

A full KYC check is $0.33 at list price, made of $0.15 for the ID document, $0.10 for passive liveness, $0.05 for face match and $0.03 for device and IP analysis. AML screening is $0.20 more if your workflow runs it. Growth applies 4% off and Scale 10% off, and billing is per completed check from prepaid credit.

Where do I keep the Didit client secret, and can I rotate it?

Keep it in your identity platform's secret store, because it authenticates your client at the PAR and token endpoints only. We show the secret once when it is issued, and we can rotate it on request. The replaced secret keeps working for a grace period of 24 hours unless you ask for another one, so a switch needs no downtime.

What must the Action validate before it trusts the ID token?

Before trusting a Didit ID token, the Auth0 Action should verify its RS256 signature against Didit's JWKS and validate the issuer, audience, expiry and original nonce. After validating the ID token, the Action checks the assurance level and allows Auth0 to continue the login only when it is VERIFIED. Skipping the validation turns a valid-looking token into an access decision you cannot defend.

What claims can I compare against the verification?

On the Auth0 profile, given_name and family_name, both compared fuzzily. You send them inside the standard OpenID Connect claims parameter of the PAR request, as a verified_claims array. The plain OpenID Connect profile releases a wider set of claims, but this guide uses the Okta and Auth0 profile.

What happens if the authorization code is redeemed twice?

Didit authorization codes are valid for 5 minutes and can be redeemed once. A second redemption is rejected and cannot complete another login. A separate login attempt needs a fresh authorization request.

Does the same integration work on Okta?

Yes. The same profile implements the delegated identity verification contract Okta uses for bring-your-own identity verification vendors on Identity Engine, and Auth0 uses the same contract. One profile, two platforms, the same endpoints and the same claim comparison.

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.