> For the complete documentation index, see [llms.txt](https://docs.developer.singpass.gov.sg/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.developer.singpass.gov.sg/docs/singpass-developer-docs/legacy-pre-fapi-2.0-api-specifications/technical-specifications/singpass-authentication-api/1.-authorization-endpoint/redirection-on-success.md).

# Redirection on success

{% hint style="danger" %}
All Login and Myinfo apps must follow Singpass' [FAPI 2.0-compliant authentication API](broken://pages/MsIagGMlUBUeCNFCcqI3) by 31 Dec 2026.

The specifications on this page apply to you only if you are maintaining an existing Login / Myinfo (v5) integration. We encourage you to [migrate](broken://pages/TjKrhykp8SG191nbTozq) early to avoid service disruptions.
{% endhint %}

Once the user has authenticated successfully, Singpass will redirect the browser to the RP’s registered `redirectUri` along with the `code` and `state` parameters or an interstitial page for users have launched authentication from the RP’s native app.

The interstitial page is required to solicit a user interaction for launching from certain in-app browsers. Singpass will redirect to the interstitial page if the `redirectUri` is custom-schemed or app-claimed HTTPS. To specify that the `redirectUri` is an app-claimed HTTPS, the RP must include the query parameter `redirect_uri_https_type=app_claimed_https` at [Authorization endpoint](/docs/singpass-developer-docs/legacy-pre-fapi-2.0-api-specifications/technical-specifications/singpass-authentication-api/1.-authorization-endpoint.md).

Example redirect location: **`https://partner.gov.sg/redirect?code=XcyzlSeX1hIyJFlstxsSF_UeXC5DtiYkFgJ8VVx52mg&state=NGRlZThmNzQtZDU5YS00YTY1LWFkODItYmE4NDA4Y2UwY2Uw`**

| Parameter | Description                                                                                                                                                                                                                                                                                 |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| code      | A securely generated random number in **base64-url** format. This parameter must be sent to the [Token endpoint](https://docs.developer.singpass.gov.sg/docs/technical-specifications/singpass-authentication-api/2.-token-endpoint) along with others to exchange for the user’s ID token. |
| state     | The same `state` parameter provided to the [Authorization endpoint](/docs/singpass-developer-docs/legacy-pre-fapi-2.0-api-specifications/technical-specifications/singpass-authentication-api/1.-authorization-endpoint.md).                                                                |

Once redirected, the RP should invoke the [Token endpoint](https://docs.developer.singpass.gov.sg/docs/technical-specifications/singpass-authentication-api/2.-token-endpoint) to obtain an ID token and complete the login process.

> Note: The `code` parameter has a lifetime of **2 minutes**. RPs must exchange it for an ID token within this period.


---

# 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.developer.singpass.gov.sg/docs/singpass-developer-docs/legacy-pre-fapi-2.0-api-specifications/technical-specifications/singpass-authentication-api/1.-authorization-endpoint/redirection-on-success.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.
