Auth and Consent
Every call to the SEP CAMARA APIs requires an OAuth 2.0 access token. Getting that token involves two steps:
Client Authentication — prove who your application is (client secret or private key JWT)
Grant Type — determine how you identify the subscriber (JWT Bearer, CIBA, Authorization Code, or Client Credentials)
1. Client Authentication Methods
Your application must authenticate itself when calling the token endpoint. Two methods are supported.
Option A — Client Secret
A shared secret issued by the platform when you create a TMF Application. Simpler to set up but the secret must be kept secure and never exposed in client-side code.
How to get it
During the TMF931 onboarding flow, create an Application via the TMF Integration page or API. The platform returns a clientSecret (also visible as "Generated Client Secret" in the MBAPI TMF Integration page). Store it securely — it is only shown once.
How to use it in a token request
Include client_id and client_secret as form parameters:
POST https://stg.api.telekom.com/token Content-Type: application/x-www-form-urlencoded grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer &assertion=<signed_subscriber_jwt> &client_id=<your_client_id> &client_secret=<your_client_secret>
Option B — Private Key JWT (Asymmetric / PRIVATE_KEY_JWT)
You sign a short-lived client assertion JWT with your own private key. The token server verifies it using the public key from your registered JWKS endpoint. No secret is transmitted — more secure and recommended for production.
Setup steps
Generate an RSA key pair (2048+ bit) or EC key pair (P-256 / ES256)
Host your public key as a JWKS JSON endpoint accessible over HTTPS, e.g. https://yourdomain.com/.well-known/jwks.json
Register the JWKS URI in your TMF Application (jwksUri field) during onboarding
Send the JWKS URI to the DT MACE team for whitelisting on the token server — this is required before private key JWT auth will work
Client assertion JWT structure
Build and sign this JWT with your private key:
// Header { "alg": "RS256", // or ES256 for EC keys "kid": "<your_key_id>" // must match a kid in your JWKS } // Payload { "iss": "<your_client_id>", "sub": "<your_client_id>", // same as iss for client assertion "aud": "https://stg.api.telekom.com/token", "iat": 1720000000, "exp": 1720000300, // max 5 minutes "jti": "<unique_uuid>" }
Token request with private key JWT
POST https://stg.api.telekom.com/token Content-Type: application/x-www-form-urlencoded grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer &assertion=<signed_subscriber_jwt> &client_id=<your_client_id> &client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer &client_assertion=<signed_client_assertion_jwt>
2. Grant Types
The grant type determines how the subscriber identity is proven. Choose the grant type based on the API you are calling.
JWT Bearer
Most common
What: Your application signs a JWT assertion that identifies the subscriber (phone number). No user interaction is needed — fully machine-to-machine.
When to use: KYC, Sim Swap, Location Retrieval, Number Recycling, QoD, NV2, and most other CAMARA APIs.
Flow: Sign a JWT with the subscriber's phone number as sub → exchange at /token → use returned access_token to call the API.
JWT bearer assertion payload
{ "iss": "<your_client_id>", "sub": "tel:+491701234567", // subscriber phone in E.164, prefixed with "tel:" "aud": "https://stg.api.telekom.com/token", "iat": 1720000000, "exp": 1720000300, "jti": "<unique_uuid>", "scope": "sim-swap:check dpv:FraudPreventionAndDetection" }
Token request
POST https://stg.api.telekom.com/token Content-Type: application/x-www-form-urlencoded grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer &assertion=<signed_jwt_above> &client_id=<your_client_id> &client_secret=<your_client_secret>
CIBA — Client Initiated Backchannel Authentication
What: Triggers a network-side authentication challenge to the subscriber's SIM. For consent-based flows, the subscriber receives an SMS with a link to the privacy portal. The client polls until authorization is granted.
When to use: Location Verification v1 / v2 (Germany), Device Roaming Status (Germany production).
Flow: POST to /bc-authorize with the subscriber hint → the subscriber follows the SMS link to the privacy portal and grants consent → receive auth_req_id → poll /token every few seconds until authorization is granted.
Step 1 — Backchannel authorization request
POST https://stg.api.telekom.com/bc-authorize Content-Type: application/x-www-form-urlencoded scope=openid location-verification:verify dpv:FraudPreventionAndDetection &login_hint=tel:+491701234567 &client_id=<your_client_id> &client_secret=<your_client_secret> // Response: { "auth_req_id": "abc123", "expires_in": 120, "interval": 5 }
Step 2 — Poll token endpoint every interval seconds
POST https://stg.api.telekom.com/token Content-Type: application/x-www-form-urlencoded grant_type=urn:openid:params:grant-type:ciba &auth_req_id=abc123 &client_id=<your_client_id> &client_secret=<your_client_secret> // While pending: HTTP 400 { "error": "authorization_pending" } // When granted: HTTP 200 { "access_token": "...", ... }
Authorization Code
What: The subscriber authorizes via a browser redirect. For consent-based flows, the subscriber is redirected to the privacy portal to grant consent, then redirected to the registered redirect URI with an authorization code to exchange for a token. For network-based flows (on cellular), this can happen silently without user interaction.
When to use: Number Verification v1, QoD (network-based on cellular).
Flow: Redirect user to /authorize → subscriber grants consent in the privacy portal (or authorizes silently on-net for network-based flows) → network redirects back with code → exchange code for token at /token.
Step 1 — Build the authorization URL and redirect
GET https://stg.api.telekom.com/authorize ?response_type=code &client_id=<your_client_id> &redirect_uri=https://yourapp.com/callback &scope=openid number-verification:verify dpv:FraudPreventionAndDetection &state=<random_opaque_value> &nonce=<random_nonce>
Step 2 — Network redirects back with code
GET https://yourapp.com/callback ?code=<authorization_code> &state=<same_state_value>
Step 3 — Exchange code for token
POST https://stg.api.telekom.com/token Content-Type: application/x-www-form-urlencoded grant_type=authorization_code &code=<authorization_code> &redirect_uri=https://yourapp.com/callback &client_id=<your_client_id> &client_secret=<your_client_secret>
Client Credentials
What: Pure machine-to-machine. The token is scoped to the application itself — no subscriber identity.
When to use: Health check endpoints, NV2 health, some admin flows where no subscriber context is needed.
Token request
POST https://stg.api.telekom.com/token Content-Type: application/x-www-form-urlencoded grant_type=client_credentials &client_id=<your_client_id> &client_secret=<your_client_secret> &scope=<requested_scope>
3. Consent-Based Flows
This section applies where the API requires consent and consent cannot be delegated.
CIBA: The subscriber receives an SMS containing a link to the privacy portal. They open the link and grant consent there while your application polls the token endpoint. When consent is granted, the polling request returns an access token.
Authorization Code: Your application redirects the subscriber to the privacy portal. After the subscriber grants consent, the privacy portal redirects the browser to your registered redirect_uri with an authorization code. Exchange that code at the token endpoint for an access token.
Consent lifetime and revocation: All consent is set up as valid until revoked. To revoke consent, the subscriber returns to the privacy portal and turns off the relevant consent there.