> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuro-tech.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Login sessions and Agent API access

> Associate an approved identity with a Neuron HTTP session or a proxy's cookie session

Session modes let the Neuron act as the backend. Use them when Neuron-hosted pages, scripts, or an Agent API integration require a Quick Login HTTP session.

## Neuron-hosted pages

On a page rendered by the Neuron, call `QuickLoginServiceId(Request)` in Neuron Script and emit the result as the QR element's `data-serviceId`:

```html theme={null}
<div id="quickLoginCode"
     data-mode="base64"
     data-serviceId="{{QuickLoginServiceId(Request)}}"
     data-purpose="Sign in to this Neuron with my Legal Identity."></div>
```

The double-brace expression is evaluated by the **Neuron**, not by Mintlify or ordinary HTML. Include the event and QR clients described in the [browser quickstart](/quick-login/quickstart).

When the user approves, the Neuron stores a user object in the session variable `QuickLoginUser` and signals the web client through `SignatureReceivedBE`. The user has **no default privileges**; application permissions must be assigned separately.

The documented overload `QuickLoginServiceId(Request, Timeout)` also requests Agent API login, with `Timeout` expressed in seconds. Confirm the token delivery and allowed lifetime with your provider.

## Session-proxy mode

A backend proxy can initiate a session without rendering a page on the Neuron. Add `agentApiTimeout` to the normal QR request:

```json theme={null}
{
  "serviceId": "",
  "tab": "<REGISTERED_TAB_ID>",
  "mode": "base64",
  "purpose": "Authorize Example to access my Neuron account.",
  "agentApiTimeout": 900
}
```

The Neuron creates a service registration implicitly and includes `serviceId` in the response. Preserve the HTTP cookies across requests and keep the event transport associated with the same session. A server-side HTTP client needs a cookie jar; calling `fetch` repeatedly does not automatically create one in Node.js.

Events use the same transport as the reference `Events.js` and `QuickLogin.js`. Verify the deployment's completion payload and session behavior before depending on token delivery. Do not infer a token field from the browser-only identity response.

## Exchange an existing session

For a supported existing Quick Login session, the separate Agent API endpoint accepts:

```javascript theme={null}
const response = await fetch("/Agent/Account/QuickLogin", {
  method: "POST",
  credentials: "include",
  referrer: window.location.origin + "/",
  referrerPolicy: "strict-origin",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ seconds: 900 })
});
if (!response.ok) throw new Error(`Session exchange failed: ${response.status}`);
const { jwt, userName, expires } = await response.json();
```

This relative URL must run on the Neuron's origin or through your configured proxy. It cannot exchange the browser-only demo result. See the [Agent API endpoint reference](/neuron-api/api-reference/authentication-and-sessions/quick-login) for prerequisites and response fields, and [login flows](/neuron-api/guides/login-flows) for remote-Neuron login.

Use HTTPS, retain cookies securely, and keep JWTs out of URLs and logs. Cross-origin browsers also require credentialed CORS and compatible cookie attributes; a successful browser-only demo does not prove session mode will work from the same origin.

Source: [Quick Login session and session-proxy modes](https://eu.quicklog.in/QuickLogin.md#sessionMode).
