> For the complete documentation index, see [llms.txt](https://docs.parallels.com/landing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.parallels.com/landing/ras-client-integration-guide/ras-web-client-api/authentication-handoff-api/backend-initiated-handoff.md).

# Backend-Initiated Handoff

If your frontend does not have access to the user's credentials for example, when credentials are stored or brokered only by your backend the handoff POST can be initiated from your backend instead of the browser.

### How it works

1. Your backend submits the POST to `<https://<user-portal-domain>>/userportal/auth-handoff` with the same payload described in **Request Payload**.
2. The Gateway returns the resulting redirect (`3xx`, typically `302`) to your backend.
3. Your backend returns that redirect to the browser as a short hop.
4. The browser follows the Gateway-issued redirect to the User Portal destination.

The end state is identical to the frontend-initiated flow: the browser ends up at the User Portal destination returned by the POST response.

{% hint style="info" %}
**Note**: The backend-initiated flow is intended only for the case where the frontend does not have access to the credentials. If the browser has the credentials, POST directly from the frontend it is simpler and avoids relaying the redirect through your backend.
{% endhint %}

### Your responsibilities in this flow

* Submit the POST from the backend where the credentials are located.
* Relay the Gateway's redirect response to the browser unchanged.
* Do not inspect or modify the redirect target or any tokens it carries — token creation, validation, and session handling are managed by the User Portal Gateway.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.parallels.com/landing/ras-client-integration-guide/ras-web-client-api/authentication-handoff-api/backend-initiated-handoff.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
