> 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
