APIs & services / Bridge session API (ctld)

Sign the user in and get a session token.

Endpointtoday's app
Call
POST /ctld/api/session/v1
Service
Bridge session API (ctld)
Features
Login, App startup and role detection
When
Login screen submit; silently again whenever a token is invalidated (401)
Auth
Username and password in request headers
In the App Service

Use case

Verified live on 2026-10-22 against the dev server (debug build, emulator, ap.gov test user). SplashActivity opens the account-lib login screen when no Bridge account exists. The user types login name, organisation and password; the name is sent as login@@tenant. A username like user@@tenant selects BridgeAccountType.USER, whose path is /api/session/v1 (IE accounts would use /api/iesession/v1-v3; Urvi never does). BridgeSessionHelper.createSession sends a POST with no body; the credentials travel as X-USER and X-PASS headers. The session id comes back in the X-SESSIONID response header and is stored as the AccountManager auth token. Authenticator.getAuthToken repeats the same call with the password stored in AccountManager whenever the token is invalidated after a 401. {base} is bridge_base_url (dev: https://dev.platformcommons.org) or, for user@@ap.gov when federation is on, federation_url (https://ryss.ap.gov.in), followed by the techl prefix /ctld (BaseURLUtil.getBaseURLWithTechl). The URL is built as {base}/ + /ctld, so the request goes to …org//ctld/api/session/v1 with a double slash; the server accepts it.

Headers

HeaderValueNotes
X-USERuser_a@@ap.govLogin name plus @@tenant, lower-cased.
X-PASS<password>Plain-text password in a request header (TLS only). Also stored in AccountManager for silent re-login.
X-APPID109Urvi app id on the Bridge platform (observed).
X-APPVERSION2.2.13versionName (observed).
X-APPKEY<redacted: hardcoded value at app/src/{debug,release}/res/values/build_type_config.xml:7>Fixed app key read by AppInfoManager.java:22. A shared secret shipped in the APK.
X-APPCODEorg.platformcommons.urviPackage name; org.platformcommons.urvi.debug on debug builds (observed).
X-DEVICEIDa1b2c3d4e5f6071816 hex characters returned by PUT /ctld/api/device/deviceid/v1 just before (observed format).

Request

No body. Credentials go in the X-USER and X-PASS headers.

Response

Example response body (synthetic data)
{
  "_note": "Success: the token is the X-SESSIONID response header; the body is not read.",
  "failureExample(401)": {
    "errorCode": "ERR_PLATFORM_SECURITY_UNAUTHENTICATED",
    "errorMessage": "Unable to process your request"
  }
}
FieldTypeRequiredNotes
X-SESSIONID (response header)stringSession token. Stored as the AccountManager auth token and sent as X-SESSIONID on every later API call.
(body)stringRead only on failure: becomes the LoginException message shown on the login screen.

Errors

StatusWhenWhat the app does
401Unknown user, wrong password, or a user that does not exist on this server (observed when dev users were sent to production)The JSON body becomes the LoginException message on the login screen. Observed body: {"errorCode":"ERR_PLATFORM_SECURITY_UNAUTHENTICATED","errorMessage":"Unable to process your request"}.
device id PUT != 200Device registration fails first'Device registration failed'; the session call is never made.
401 on a later API callSession expiredAuthInterceptor / CoreAPI invalidate the token; Authenticator silently calls this endpoint again with the stored password.

Source

  • account-lib/library/src/main/java/com/mindtree/bridge/accountlib/AuthenticatorActivity.java:411-423
  • account-lib/library/src/main/java/com/mindtree/bridge/accountlib/Authenticator.java
  • account-lib/library/src/main/java/com/mindtree/bridge/accountlib/helper/LoginHelper.java
  • account-lib/library/src/main/java/com/mindtree/bridge/accountlib/utils/BaseURLUtil.java:66
  • bridge-security-api 8.0.3: com.mindtree.bridge.security.BridgeSessionHelper.createSession, BridgeAccountType (read with javap from the Nexus artifact)
  • account-lib/library/src/main/java/com/mindtree/bridge/accountlib/AuthenticatorActivity.java
  • app/src/main/java/org/platformcommons/urvi/view/splash/SplashActivity.kt