Connect Your Existing Login
When a personal agent wants to act for your user, your user first signs in and approves the agent in the approval flow. The approval flow is the Descope Flow that Agent Login creates. By default, it signs your user in with a Descope method, such as one-time codes or enchanted links. Your API then links the agent to your user's account by email or phone number, as Account Linking describes, and your login needs no changes.
Some companies want agent sign-in to use the same page and the same credentials as their regular sign-in, without moving their users to Descope. For that, the approval flow hands the sign-in to your existing login. Your user signs in where they always do, and your system tells Descope which account signed in.
Select any step to see what happens.
Not on another login provider?
Already on Descope? You have nothing to connect. See Already on Descope.
No customer accounts yet? See No login yet.
If you haven't set up Agent Login yet, start there. Agent Login creates the approval flow that you change on this page.
Ways to Use Your Login
The approval flow can reach your existing login in two ways, and what your login supports decides which one you use. Each way is a step that you add to the same Log In & Consent Flow. The Bring Your Own Auth guide covers more ways, such as checking passwords against your own API.
| If your users sign in with | How the flow signs them in | How your site knows the account |
|---|---|---|
| A login provider that supports OIDC or SAML, the standard sign-in protocols. Most hosted login providers support at least one. | Federation: the flow sends your user to that provider to sign in. | The provider tells Descope who signed in. |
| A login page your team built, without OIDC or SAML | External Authentication: the flow sends your user to your page. | Your backend tells Descope the account's login ID. |
Federation is the recommended way when your login provider supports OIDC or SAML, because your team writes no code for it. When your team built the login page and it supports neither protocol, use External Authentication. Each section below covers the setup in short, and the Bring Your Own Auth guide has the full steps.
With either way, your user signs in through their own browser, and the agent never sees a password. After your login, the approval flow continues to the consent screen, so your login page doesn't need to know anything about agents. Agent Login covers the consent screen and how to skip it.
Federation
Your identity provider (IdP) is the service that signs your users in today. With federation, the approval flow sends your user to your IdP, and your IdP tells Descope who signed in.
Select any step to see what happens.
To set it up, add your IdP to Descope as a custom OAuth provider or as a tenant-level SSO connection. Then use it as the sign-in step in the approval flow. The Bring Your Own Auth guide covers the details.
External Authentication
With External Authentication, your login page signs your user in, and your backend tells Descope which account signed in. The agent starts the sign-in in one of two ways. With a device sign-in, the agent shows your user a link and a code. With the authorization code flow, the agent sends your user to the sign-in page. Every later step happens in your user's browser and on your backend.
Select any step to see what happens.
To set it up, open Log In & Consent Flow under Authentication on the Agent Login page. Replace the flow's sign-in methods with the External Authentication action, and set its External Auth URL to your login page. Leave the Update User Consent action in place after the consent screen.
After your user signs in, your backend completes the request with the request ID and the account's loginId. Descope connects the agent to that account, so send your own stable account ID, not what the user typed. The External Authentication action page covers the completion call and every request field.
Account Linking
Your site and Descope each keep their own record of your user. Account linking tells your API which of your accounts a Descope token belongs to. Your backend tells Descope which account signed in, then saves the Descope user ID next to that account. The load user endpoint returns that ID. When the agent calls your API, your API uses the saved ID to find the account.
Select any step to see what happens.
With External Authentication, the loginId your backend sends is the link. Federation uses the identity your IdP returns instead, and the same rule applies to that identity. Descope signs every later login with the same ID into the same Descope user, so the ID has to belong to one account for good. An email works only if your system never moves an address to another account. Otherwise, send your own stable account ID.
The same rule applies when Descope signs your user in and your API links the account by email or phone number. Match only on an address that your system verified and never moves to another account. Carriers often recycle phone numbers, so if addresses can change hands, use your existing login instead.
Northbound, the Descope sample store, sends the account's email as the login ID. Its API matches the token's email claim to a customer and reads the agent from the act.sub claim.
A user with two accounts at your company, such as a personal and a business account, gets a separate Session and refresh token for each. To keep their carts apart, your API can refuse a request whose access token names a different account than its Session used before. Your API returns the session_ended error in that case, and the agent starts a new Session.
Accepting Agent Tokens on Your APIs
Your APIs trust tokens from your current provider, not from Descope. An agent's access token comes from Descope, so each API that agents call needs a way to accept it. The Poppy guides describe three ways, and you can mix them across your APIs.
- Validate the Descope token directly: Your API or gateway validates the token with session validation or token introspection. Your API then maps the token to your account as Account Linking describes. Start here, because this way needs no change to your current provider. Northbound works this way.
- Validate at the edge and pass identity inward: A worker or gateway in front of your site validates the token. The worker or gateway then forwards the verified account, agent, and scopes to your origin in headers. Your origin then reads headers instead of tokens. The Poppy guides recommend this split for internal services, so a token never travels between your services.
- Exchange for your current provider's token: Your backend exchanges the Descope token for a token from your current provider, and your APIs keep trusting only that provider. Your provider runs that exchange, so your provider has to support token exchange and trust Descope as an issuer.
Whichever way you choose, check the scopes and the act claim on every request. Where your API keeps state across requests, such as a cart, your API also verifies the Poppy-Session header before it uses the Session ID.
Revocation From Your Side
Your system knows about events that Descope doesn't, such as a password reset or a suspected compromise. The Poppy guides recommend that you revoke a user's refresh tokens when either event happens.
Your backend can revoke agentic identities through the Management API. A call with only userId revokes every agent that acts for that user. The userId is the Descope user ID from the token's sub, not your own account ID, and your backend saves it when it links the account. The agent's Sessions then continue signed out, so the agent can still do anything that doesn't need the account.
You can also show your users their connected agents in your own account settings. List the agents with search agentic identities, and revoke one with its clientId and the same Descope user ID.
In the Console, the Agentic Identity page lists the same identities, one row for each agent and the user it acts for.

Moving Your Login to Descope Later
Every customer who approves an agent becomes a Descope user, with the login ID your backend sent. If you later move your customer login to Descope, those users carry over, and you no longer need External Authentication or a second token check on your APIs. Migrating to Descope covers how to move users and sessions from your current provider.