TutorialsOfficial documentation6 min readTutorials

Retrieve FastGPT SSO Login Redirect URL

This GET endpoint returns a pre-configured SSO login redirect URL for FastGPT administrative single sign-on setups.

Overview

This GET endpoint returns a pre-configured SSO login redirect URL for FastGPT administrative single sign-on setups. When invoked, FastGPT automatically appends the required redirect_uri query parameter to the generated URL, which specifies the callback location the identity provider will use to return to FastGPT after successful authentication.

Request Specifications

All requests must include the required query parameters and HTTP headers as outlined below:

FieldTypeRequirementDetails
redirect_uriQuery stringRequiredCallback URI for post-authentication redirection
stateQuery stringRequiredOpaque random value to mitigate cross-site request forgery (CSRF) risks
AuthorizationHTTP HeaderRequiredBearer token for administrative API access, formatted as Bearer [REDACTED_CREDENTIAL]
Content-TypeHTTP HeaderRequiredMust be set to application/json

The following curl command demonstrates a valid request:

curl -X GET "https://redict.example/login/oauth/getAuthURL?redirect_uri=xxx&state=xxxx" \
-H "Authorization: Bearer [REDACTED_CREDENTIAL]" \
-H "Content-Type: application/json"

Response Formats

The endpoint returns a JSON object with three top-level fields: success (boolean status indicator), message (human-readable status details), and authURL (the generated SSO login redirect URL).

Success Response

A successful request returns a 200 OK HTTP status code with the following JSON structure:

{
  "success": true,
  "message": "",
  "authURL": "https://example.com/somepath/login/oauth?redirect_uri=https%3A%2F%2Ffastgpt.cn%2Flogin%2Fprovider%0A"
}

Failure Response

A failed request returns a 200 OK HTTP status code (consistent with FastGPT API standards) with the following JSON structure, where message contains a descriptive error string:

{
  "success": false,
  "message": "Error message",
  "authURL": ""
}

Source: FastGPT official source

Applicability and version scope

Use this page for the documented Tutorials scenario. Confirm the FastGPT, dependency, API, and deployment versions in the official source before applying a change.

Safety guardrails

Use [REDACTED_CREDENTIAL] for credentials and private data. Confirm the documented environment and version before review.

Rollback guidance

Restore the prior technical-content authority snapshot. Restore saved configuration and data snapshots, then repeat the smallest verification scenario.