Skip to main content
Welcome to the RollingGo OAuth 2.0 authorization service! This document helps third-party developers integrate RollingGo account login into their own applications. We support the standard OAuth 2.0 Authorization Code Grant, and strongly recommend clients (especially public clients such as mobile, desktop, and SPA) use the PKCE (Proof Key for Code Exchange) security extension. RollingGo provides two service nodes. The integration flow and parameters are identical across nodes; only the endpoint domains differ. Choose the node that matches your target users:
The MCP Host is the host of the RollingGo MCP (Model Context Protocol) service, which allows AI applications (e.g., agents, LLM clients) to connect to RollingGo hotel capabilities via the standard MCP protocol. The connection URL is https://<MCP_HOST>/mcp/hotel; see “Scenario 2: Connecting to the MCP Service” below.
In the examples below, the <API_DOMAIN> and <MCP_HOST> placeholders are used throughout. Replace them with the domains of your corresponding node.

🚀 Authorization Flow

Before you start: Make sure you have obtained your client_id (client ID) from RollingGo, and that RollingGo has configured the allowed redirect_uri(s) (redirect URI) for you. If not yet obtained, please contact your onboarding Business Manager.
The integration flow consists of three steps:
  1. Direct the user to the authorization page to obtain an authorization code (code).
  2. Receive the redirect and extract the authorization code (code).
  3. Exchange the authorization code (code) for an access token (access_token).

Step 1: Request Authorization

Your application should redirect the user to the RollingGo authorization endpoint. Method: GET Request URL (choose based on your node):
  • Mainland China: https://api.rollinggo.cn/oauth2/authorize
  • Overseas, Hong Kong, Macao & Taiwan: https://api.rollinggo.ai/oauth2/authorize
Request Parameters (Query): Request Example (replace <API_DOMAIN> and <MCP_HOST> with your node’s domains):
Error Responses:
User experience note: If all parameters pass validation, RollingGo displays the sign-in page (email + verification code login). After the user signs in, if this is the app’s first authorization, a consent screen lists all requested scopes and their meanings. After the user confirms, the browser redirects to the redirect_uri with the authorization code.

Step 2: Handle Callback

After the user signs in and consents on the RollingGo page, the browser will redirect to the redirect_uri you provided in Step 1, with the authorization code (code) appended to the URL’s query string. Redirect Example:
Callback Parameters: Error Callback Example (when the user denies authorization or an error occurs):

Step 3: Exchange Code for Token

Once you have the code, your backend service (or a public client using PKCE) must send a POST request to the RollingGo token endpoint to exchange the code for an access_token. Method: POST Request URL (choose based on your node):
  • Mainland China: https://api.rollinggo.cn/oauth2/token
  • Overseas, Hong Kong, Macao & Taiwan: https://api.rollinggo.ai/oauth2/token
Content-Type: application/x-www-form-urlencoded (application/json is not supported) Request Parameters (Body):
Note: The refresh_token is only returned in the response when you use a confidential client (i.e., one configured with client_secret). Public clients do not receive a refresh_token.
Request Example (Curl, confidential client):
Request Example (Curl, public client + PKCE):
Successful Response Example (HTTP 200):
Response Parameter Description: Error Response Example (HTTP 400):
Support & Contact: If you encounter an invalid client_id, a redirect_uri mismatch, a lost client_secret, or any other configuration-related issue during integration, please contact your RollingGo Business Manager team for assistance.

🛡️ Security Recommendation: PKCE (Required Reading)

PKCE (Proof Key for Code Exchange) prevents the authorization code from being used after interception. For public clients without a backend — pure frontend apps (SPA), desktop, or mobile — we strongly recommend using PKCE, avoiding hardcoding client_secret in client code. Both Step 1 and Step 3 use the values generated below. How it works:
  1. Generate code_verifier: The client generates a high-entropy random string (43-128 characters, using only [A-Z] / [a-z] / [0-9] / "-" / "." / "_" / "~").
  2. Compute code_challenge: SHA256-hash the code_verifier, then Base64URL-encode it (without = padding).
  3. Request the authorization page (Step 1): Send code_challenge and code_challenge_method=S256.
  4. Exchange the token (Step 3): Send the original code_verifier without client_secret (public clients). RollingGo performs the same SHA256 computation and compares; a mismatch results in token refusal.

🛠️ Using the Access Token (Accessing Protected Resources)

Once you have the access_token, you can access the protected resources provided by RollingGo on behalf of the user, or connect to the MCP Server. Simply place the access_token in the Authorization HTTP header, prefixed with Bearer (note the trailing space).

Scenario 1: Accessing REST API Resources (User Info)

For example, access the user info endpoint /userinfo: Request Example (Curl):
Successful Response Example (HTTP 200):

Scenario 2: Connecting to the MCP (Model Context Protocol) Service

When your MCP client establishes an SSE or WebSocket connection with the RollingGo MCP Server, you must also include the authentication header in the initial HTTP request.
  • Mainland China MCP Server: https://mcp.rollinggo.cn/mcp/hotel
  • Overseas, Hong Kong, Macao & Taiwan MCP Server: https://mcp.rollinggo.ai/mcp/hotel
SSE Connection Example (Node.js/JS pseudocode):
MCP SDK Client Connection Example (TypeScript):

Scenario 3: Refreshing the Token with refresh_token

When the access_token expires, you can use the refresh_token to obtain a new access_token without requiring the user to sign in again.
Applicability: The refresh_token is only valid for confidential clients (configured with client_secret). Public clients do not receive a refresh_token; for long-term access, go through the authorization flow again.
Method: POST Request URL (choose based on your node):
  • Mainland China: https://api.rollinggo.cn/oauth2/token
  • Overseas, Hong Kong, Macao & Taiwan: https://api.rollinggo.ai/oauth2/token
Request Parameters (Body): Request Example (Curl):
Successful Response Example:
Important: After using the refresh_token, the response may include a new refresh_token. Rely on the actual response and securely store the new refresh_token each time.

Scenario 4: Revoking a Token

When the user signs out or you need to invalidate a token, call the revocation endpoint. Method: POST Request URL (choose based on your node):
  • Mainland China: https://api.rollinggo.cn/oauth2/revoke
  • Overseas, Hong Kong, Macao & Taiwan: https://api.rollinggo.ai/oauth2/revoke
Request Parameters (Body): Request Example (Curl):
Successful Response: HTTP 200 (empty response body)

Scenario 5: Token Introspection

Used to verify whether a token is valid and to obtain its metadata (for resource server-side validation). Method: POST Request URL (choose based on your node):
  • Mainland China: https://api.rollinggo.cn/oauth2/introspect
  • Overseas, Hong Kong, Macao & Taiwan: https://api.rollinggo.ai/oauth2/introspect
Request Parameters (Body): Request Example (Curl):
Successful Response Example (when the token is valid):
Response When the Token Is Invalid:

📋 Appendix: Basic Information (Reference)

This appendix is for manual configuration and troubleshooting. Normal integration does not require reading it. RollingGo provides the standard OAuth 2.0 / OpenID Connect service discovery mechanism. Developers can directly request the following endpoints to automatically obtain all configurations supported by the authorization server (including endpoint URLs, supported scopes, signing algorithms, etc.):
  • OAuth 2.0 Discovery Endpoint: https://<API_DOMAIN>/.well-known/oauth-authorization-server
  • OIDC Discovery Endpoint: https://<API_DOMAIN>/.well-known/openid-configuration

Core Endpoint Overview

Supported Scopes

The scope list above exactly matches the scopes_supported returned by the authorization server’s .well-known/oauth-authorization-server endpoint.
Note: When requesting write-operation scopes such as hotel:order:book and hotel:order:cancel, the consent page explicitly informs the user that the app will perform these operations on their behalf. Users may decline some scopes.

Server Capability Summary

Based on the actual configuration returned by the service discovery endpoints, the RollingGo authorization server supports the following capabilities:
The content in this table is derived from the actual configuration returned by the authorization server’s .well-known/oauth-authorization-server and .well-known/openid-configuration endpoints. Beyond the authorization code flow demonstrated in this document, if you need to use flows such as device_code or token-exchange, please contact your onboarding Business Manager for the corresponding integration instructions.
Last modified on October 22, 2026