corppass-legacy
Skill16 starsChanged 4 months agoMITView on GitHub
Maintain, debug, or migrate a LEGACY Corppass integration — the pre-FAPI 2.0 Corppass Authorization API (entityInfo/userInfo ID-token claims, the comma-separated sub format, /authorization-info, Bearer access tokens, esrvcID) or Myinfo Business v1/v2 (/entity-person, PKI_SIGN, client_secret). Use this whenever an existing Corppass integration predates March 2026, when code or API responses reference CPEntID, CPAccType, ISSPHOLDER, TPAuthInfo, ESrvc_Row_Count, or authmode — even inside an otherwise-new FAPI 2.0 integration — or when planning the mandatory migration: legacy API by 31 March 2027, Myinfo Business v1/v2 to v3 by 31 May 2027. Covers the legacy wire formats, the legacy-to-FAPI 2.0 claim mapping, and the migration checklist. For new integrations use the corppass skill instead — new services cannot onboard to the legacy API.
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- access-controlSkill
- container-securitySkill
- corppassSkill
- data-protectionSkill
- dss-accessibilitySkill
- gen-ai-securitySkill
- logging-monitoringSkill
- network-securitySkill
- resiliency-recoverySkill
- secure-coding-asSkill
- secure-pipelineSkill
- security-testingSkill
- sg-service-shellSkill
- singpass-legacySkill
- singpassSkill
- ssp-navigatorSkill
- transactions-paymentsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Every Corppass integration onboarded before 23 March 2026 runs on the legacy Corppass Authorization API.
- Very specific: line 51
Scopes: only openid, authinfo, tpauthinfo.
- Distinctive: line 121
When reviewing a migration plan or a half-migrated codebase:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Corppass legacy: maintain and migrate pre-FAPI 2.0 integrations
Every Corppass integration onboarded before 23 March 2026 runs on the legacy Corppass Authorization API. It still works, but it is on a countdown:
| What you have | Deadline | After that |
| Legacy Corppass Authorization API | migrate by 31 March 2027 | legacy security profile deprecated 1 April 2027 |
| Myinfo Business v1/v2 | migrate to v3 by 31 May 2027 | v1/v2 deprecated |
Submit your migration plan (current progress + target date) at https://go.gov.sg/cp-fapi-migration-plan. New services cannot choose legacy — for anything greenfield, use the corppass skill. This skill exists for two jobs: keeping an existing legacy integration healthy until it migrates, and executing the migration correctly.
Source and currency
Embedded from https://docs.corppass.gov.sg as of 2026-07-23 (legacy API spec +
migration guides). Append .md to any live docs page URL for markdown; index at
https://docs.corppass.gov.sg/llms.txt. Read
references/legacy-api-and-migration.md for the full legacy wire formats, the
verbatim claim-mapping table, and both migration checklists.
The legacy shape (what you are maintaining)
Same hosts as FAPI 2.0 (stg-id.corppass.gov.sg / id.corppass.gov.sg), different
mechanics:
- Front-channel authorization:
GET /mga/sps/oauth/oauth20/authorizewithscope,response_type=code,client_id,redirect_uri,state,nonce, PKCE challenge, and (deprecated)esrvcID— all in the browser URL. Redirects during Singpass login use HTTP 303 (since v2.0). - Scopes: only
openid,authinfo,tpauthinfo. - Token endpoint returns
token_type: "Bearer"(not DPoP), a JWE ID token, and a Bearer-used JWS access token (10 minutes). - Legacy ID token is flat, and its
subis the user, as a comma-separated string:"s=S1234567P,uuid=0f14a2fc-...,u=CP192,c=SG"— key order not guaranteed since v2.1; parse by key, never by position. Entity data sits in theentityInfoclaim (CPEntID,CPEnt_TYPE,CPEnt_Status,CPNonUEN_*), user metadata inuserInfo(CPAccType— Administrator/Sub-Administrator/User/Enquiry User,CPUID_FullName,ISSPHOLDER). - Authorization data comes from
GET /authorization-infowithAuthorization: Bearer <token>— a JWS (signed, not encrypted) whose payload carries PascalCaseAuthInfo/TPAuthInfo(sameResult_Setrow shapes as the FAPIauth_info). - Crypto:
private_key_jwtclient assertions (ES256-family), PKCE S256, JWE ID tokens (ECDH-ES+A128KW/A192KW/A256KW+A256CBC-HS512). No PAR, no DPoP. - Legacy JWKS responses include
x5c/x5t/x5t#S256— deprecated; do not build on them. SSO support was removed in v2.0 (May 2024). Theemail/email_verifiedID-token claims were a restricted beta and are deprecated — do not adopt them. - Myinfo Business v1/v2 is a different API family entirely:
https://api.myinfo.gov.sg/biz/[v1|v2]with/authorise,/token(client_secret!), and/entity-person/{uen}/{uuid}— the uen/uuid taken from the decoded access token, which v3 forbids.
Debugging tips that differ from FAPI 2.0: the authorization code lives 10
minutes (not 60 s); Bearer on /authorization-info is correct here; the
response needs signature verification but no decryption.
The migration, in essence
The migration is not an endpoint swap — the identity model flips underneath you:
subchanges meaning. Legacysub= the user (comma-separated string). FAPI 2.0sub= the entity (UEN / Corppass Entity ID); the user moves toact.subas a bare UUID. Any code that treatssubas a person silently mis-identifies entities after migration. Map:entityInfo.CPEntID→sub/sub_attributes.entity_reg_number;CPEnt_TYPE→sub_attributes.entity_type;CPEnt_Status→sub_attributes.entity_uen_status; legacysub'suuid=→act.sub;userInfo.CPUID_FullName→act.sub_attributes.name. No FAPI equivalent exists forCPAccTypeorISSPHOLDER— if your logic branches on them, redesign it (role logic belongs onauth_inforows).- Front-channel → PAR. Sensitive params move to a back-channel
POST /request; the browser carries onlyclient_id+request_uri(60 s). Corppass Login apps must addauthentication_context_type(APP_AUTHENTICATION_DEFAULTis auto-backfilled for existing clients). - Bearer → DPoP. DPoP proofs on PAR, token, and userinfo; ephemeral EC key per
session;
athclaim at userinfo;Authorization: DPoP. /authorization-info→/userinfo. JWS → JWE (you now need anenckey in your JWKS and decrypt-then-verify); PascalCaseAuthInfo/TPAuthInfo→ snake_caseauth_info/tp_auth_info; row shapes unchanged.- TTLs tighten. Auth code 10 min → 60 seconds; client assertion lifetime
capped at 2 minutes with mandatory unique
jti;request_uri60 s. - Config prerequisites. At least one https redirect URL registered (or PAR
initialization is refused); custom app schemes banned; review the auto-backfilled
finer-grained scopes and drop what you don't need; same discovery URL — re-fetch
it to pick up
pushed_authorization_request_endpointanduserinfo_endpoint. - Same client_id for the API migration — but Myinfo Business v1/v2 → v3
requires a NEW app on the Singpass Developer Portal; old App IDs/Client IDs are
not interchangeable. v3 also renames/drops fields (
uen→registration_number,entity-status→uen-status,gov-contracts.*dropped, several CPF person scopes dropped) — audit every consumed attribute against the v3 scope list before cutover. - Parallel run is possible: the API version is selected per-flow (PAR ⇒ FAPI 2.0, browser-redirect authorization ⇒ legacy), so you can stage the rollout behind a flag and cut over gradually.
Full step-by-step checklists (API migration and MIB v1/v2 → v3) with the verbatim
mapping tables are in references/legacy-api-and-migration.md.
Migration audit checklist
When reviewing a migration plan or a half-migrated codebase:
| Check | Failure smell |
sub parsing rewritten for the entity model | code still splits sub on commas, or reads it as a person |
sub key-order-independent parsing (if still on legacy) | sub.split(",")[0] positional parsing |
CPAccType/ISSSPHOLDER logic redesigned | branches on claims that no longer exist |
enc key added to JWKS before cutover | JWKS still sig-only; userinfo decrypt fails |
| DPoP + PAR + 2-min assertions implemented | Bearer tokens, front-channel auth params |
| Token-exchange latency budget re-tested | 10-min-code assumptions; retries past 60 s |
/authorization-info consumers moved to /userinfo | PascalCase AuthInfo parsing against snake_case payloads |
| MIB: new v3 app created on SDP; scope diff audited | reusing v1/v2 client IDs; consuming dropped fields |
| Migration plan submitted; deadline tracked | no owner for the 31 Mar / 31 May 2027 dates |
| https redirect URL registered pre-cutover | custom-scheme or http redirect still configured |
What this skill does not cover
- The target state. The full FAPI 2.0 wire spec, JWKS/DPoP/assertion details, CDP onboarding, and Myinfo Business v3 compliance live in the corppass skill — read it alongside this one when executing a migration.
- Individual-facing login — the singpass skill (and singpass-legacy for Myinfo v3/v4-era person-data integrations, which have their own deadlines).
- PDPA/NRIC handling — data-protection.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

