Skip to content
CP OAuth

Explore

About CP OAuth

Supported platforms

  • LuoguVerified with a code in a public Luogu clipboard.
  • AtCoderVerified with a code in the AtCoder profile Affiliation.
  • LeetCodeVerified with a code in the leetcode.cn profile bio.
  • CodeforcesVerified via provider sign-in.
  • GitHubVerified via provider sign-in.
  • GoogleVerified via provider sign-in.
  • Clist.byVerified via provider sign-in.

Authorization code flow

Standard OAuth 2.0 with optional PKCE (S256 or plain).

  1. Create an OAuth client in the developer console with exact redirect URIs.

  2. Send the user to the authorization endpoint with client_id, redirect_uri, response_type=code, scope, state, and PKCE code_challenge for public clients.

  3. After sign-in and consent, the browser returns to your redirect URI with a 10-minute code.

  4. Exchange the code at the token endpoint for a 1-hour access token and a 30-day refresh token.

  5. Call the userinfo endpoint with the bearer token to read granted scopes.

  6. Use the refresh token to obtain new tokens; each refresh token rotates on use.

Endpoints

  • Issuerhttps://www.cpoauth.com
  • Authorizationhttps://www.cpoauth.com/oauth/authorize
  • Tokenhttps://www.cpoauth.com/api/oauth/token
  • Userinfohttps://www.cpoauth.com/api/oauth/userinfo
  • Revocationhttps://www.cpoauth.com/api/oauth/revoke

Scopes

  • openid
    Account IDA stable identifier for your CP OAuth account.
  • profile
    Basic profileUsername, display name, avatar and bio.
  • email
    Email addressYour email address and verification status.
  • cp:linked
    All linked accountsPlatform, UID and username of every linked account.
  • link:luogu
    Linked Luogu accountUID and username of your Luogu account.
  • link:atcoder
    Linked AtCoder accountUsername of your AtCoder account.
  • link:leetcode
    Linked LeetCode accountUsername of your LeetCode account.
  • link:codeforces
    Linked Codeforces accountHandle of your Codeforces account.
  • link:github
    Linked GitHub accountID and login of your GitHub account.
  • link:google
    Linked Google accountID and email address of your Google account.
  • link:clist
    Linked Clist.by accountID and handle of your Clist.by account.
  • cp:summary
    Contest statisticsRatings and contest counts from Clist.by for matching linked accounts.
  • cp:details
    Rating historyUp to 200 recent rated contest results for matching linked accounts.