Skip to content

Commit 92da27a

Browse files
committed
updated nv doc , need revision
1 parent cf3bc9f commit 92da27a

File tree

3 files changed

+135
-34
lines changed

3 files changed

+135
-34
lines changed
207 KB
Loading

v0/catalog/numberverification/numberverification.md

Lines changed: 82 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ content:
1818
<span style={{backgroundColor: '#8a8a8a', color: 'white', borderRadius: '15px', padding: '4px 12px', fontSize: '12px', fontWeight: 'bold'}}>GSMA Certified API</span>
1919
</div>
2020

21-
Built as part of the Open Gateway initiative, the Number Verification API provides developers with universal access to essential network functionalities. Whether you're enhancing user registration processes, securing transactions, or optimizing user engagement strategies, integrating the Number Verification API enriches your application's security posture while ensuring a seamless user experience.
21+
The Number Verification API is part of the Open Gateway initiative, providing developers with access to network-based phone number validation. This API verifies user identity by confirming phone number ownership through network operator mechanisms, eliminating the need for manual verification processes.
2222

23-
> 📘 Want to give it a try?
24-
> Apply to join the [Developer Hub](https://opengateway.telefonica.com/en/developer-hub/join) and gain access to our Sandbox.
23+
Apply to join the [Developer Hub](https://opengateway.telefonica.com/en/developer-hub/join) and gain access to our Sandbox.
2524

2625
### Getting started on the Telefónica Open Gateway Sandbox
2726

@@ -36,37 +35,102 @@ Built as part of the Open Gateway initiative, the Number Verification API provid
3635
allowfullscreen>
3736
</iframe>
3837

39-
## Overview of the Number Verification CAMARA API
38+
## API Overview
4039

41-
### High level definition
40+
### Technical Definition
4241

43-
The Number Verification CAMARA API validates user identity by confirming ownership of the phone number being registered, matching it with the number identified by the operator through the user’s device connection.
42+
The Number Verification CAMARA API validates user identity by confirming that the provided phone number matches the number associated with the user's device connection to the mobile network operator.
4443

45-
### API Operations
44+
### Available Operations
4645

47-
The Number Verification CAMARA API specifies the following two operations:
48-
49-
- **POST verify:** Determines if the provided phone number matches the one currently in use by the user (parameter `phoneNumber`). This operation is ideal for user authentication.
46+
- **POST verify:** Validates if the provided phone number matches the device's registered number. Returns a boolean result indicating verification status.
5047

5148
[Check the API Reference](/reference/phonenumberverify-2)
5249

53-
- **GET device-phone-number:** Identifies the phone number currently associated with the user's device without requiring input, providing a straightforward way to retrieve this information.
50+
- **GET device-phone-number:** Retrieves the phone number associated with the user's device without requiring input parameters.
5451

5552
***This feature is pending availability***
5653

57-
The Number Verification CAMARA API enables developers to seamlessly integrate authentication mechanisms into their applications, enhancing the user experience and security. It can also be combined with other Open Gateway APIs focused on anti-fraud measures to further bolster security.
5854

59-
Integration with channel partners and service aggregators streamlines the incorporation of telco functionalities with additional security algorithms, backup authentication methods, or external data sources. This collaboration enhances service reliability and security, leveraging APIs like Device Location Verification or SIM SWAP within the Open Gateway framework.
55+
### Technical Implementation
56+
57+
The API leverages network operator infrastructure to perform verification without requiring user interaction. This network-based approach provides:
58+
59+
- Real-time validation against operator records
60+
- No dependency on SMS or voice calls
61+
- Transparent verification process for end users
62+
- Integration with existing network authentication mechanisms
63+
64+
The API can be combined with other Open Gateway APIs such as Device Location Verification or SIM SWAP detection to create comprehensive security solutions.
65+
66+
### Why Frontend-Initiated Authentication is Required
67+
68+
The Number Verification API uses **Authorization Code Flow** (frontend-initiated) instead of **CIBA (Client Initiated Backchannel Authentication)** for a critical technical reason:
69+
70+
**IP Address Verification**: The core verification mechanism compares the phone number being verified against the IP address that the mobile network operator has assigned to that specific SIM card. This comparison can only be performed when the request originates from the user's mobile device.
71+
72+
**Technical Implementation**:
73+
- When a user's device connects to the mobile network, the operator assigns a specific IP address to that SIM card
74+
- The verification request must come from this assigned IP address to establish the connection between the phone number and the device
75+
- If the request originates from your backend server, the operator sees your datacenter's IP address instead of the user's mobile IP
76+
- This breaks the verification chain, as there's no way to correlate your server's IP with the user's phone number
77+
78+
**Why CIBA Cannot Work for Number Verification**:
79+
- CIBA flows are backend-initiated and use the server's IP address
80+
- The mobile operator cannot establish a relationship between your server's IP and the user's phone number
81+
- The fundamental verification mechanism (IP-to-phone-number matching) becomes impossible
82+
83+
This architectural requirement ensures that verification is truly tied to the physical device and SIM card being used, providing authentic network-level validation that cannot be spoofed or bypassed.
84+
85+
## Use Cases and Benefits
86+
87+
Traditional verification methods using SMS or voice calls are vulnerable to SIM swapping, interception, and social engineering attacks. The Number Verification API addresses these security challenges through network-level validation.
6088

61-
## Why Number Verification?
6289
![NumberVerification Before](https://github.com/Telefonica/opengateway-developers-website/raw/main/v0/catalog/numberverification/images/NV(1).png)
6390

64-
In today's digital landscape, verifying phone number ownership is critical to prevent identity fraud and secure online transactions. The Number Verification CAMARA API offers a reliable solution to **authenticate users by confirming their phone numbers**. This ensures that only legitimate users gain access to digital services, bolstering security measures and building trust among customers.
91+
The Number Verification API provides network-level authentication that validates phone number ownership through the mobile operator's infrastructure, offering superior security compared to conventional methods.
6592

6693
![NumberVerification After](https://github.com/Telefonica/opengateway-developers-website/raw/main/v0/catalog/numberverification/images/NV(2).png)
6794

68-
### How does the Number Verification API help facilitate authentication?
6995

70-
The Number Verification API utilizes telco mechanisms to authenticate users seamlessly based on their device's connection to the network. This method contrasts with traditional authentication solutions by enhancing user convenience and security. Unlike manual processes or plain-text codes, network-based validation requires no user interaction, bolstering protection against unauthorized access.
7196

72-
This API verifies that the provided mobile phone number (MSISDN) matches the device initiating data communication, ensuring users interact with digital services from authenticated devices.
97+
For desktop applications, the Number Verification API supports cross-device authentication through QR code scanning, enabling users to verify their phone number from their mobile device while using a desktop application.
98+
99+
![NumberVerification Desktop](https://github.com/Telefonica/opengateway-developers-website/raw/main/v0/catalog/numberverification/images/NV(3).png)
100+
101+
### Key Advantages
102+
103+
**Network-Based Verification:** Utilizes the mobile network operator's authentication mechanisms, providing verification without user interaction or exposure to interception.
104+
105+
**Real-Time Validation:** Immediate confirmation of phone number ownership through active network connection verification.
106+
107+
**Enhanced Security:** Eliminates vulnerabilities associated with SMS-based verification, including SIM swapping and message interception.
108+
109+
**Seamless Integration:** RESTful API design enables straightforward integration into existing authentication workflows.
110+
111+
The API verifies that the provided mobile phone number (MSISDN) corresponds to the device establishing the data connection, ensuring users access services from authenticated devices.
112+
113+
114+
### Network-Level Authentication Mechanism
115+
116+
The Number Verification API performs authentication through **network infrastructure validation**:
117+
118+
**Core Verification Process**:
119+
1. **IP Address Correlation**: The mobile operator identifies which SIM card is assigned to the IP address making the request
120+
2. **Phone Number Matching**: The operator compares the provided phone number with the SIM card associated with that IP address
121+
3. **Real-Time Validation**: This comparison happens instantly using live network data, not stored databases
122+
123+
**Technical Advantages**:
124+
- **No User Interaction Required**: Verification is transparent to the end user
125+
- **Immune to SIM Swapping**: Uses current network connection, not historical data
126+
- **Cannot Be Intercepted**: No SMS or voice calls that can be redirected
127+
- **Spoofing-Resistant**: Requires actual network connection from the specific SIM card
128+
129+
**Key Advantages Over Traditional Methods**:
130+
- **Network-Based Verification**: Utilizes mobile operator authentication mechanisms without user interaction
131+
- **Real-Time Validation**: Immediate confirmation through active network connection verification
132+
- **Enhanced Security**: Eliminates SMS/voice vulnerabilities including SIM swapping and interception
133+
- **Seamless Integration**: RESTful API design for straightforward authentication workflow integration
134+
- **Spoofing-Resistant**: Requires actual network connection from the specific SIM card
135+
136+
This verification confirms that the provided mobile phone number (MSISDN) corresponds to the SIM card currently establishing the data connection, ensuring authentic device-to-identity binding.

v0/catalog/numberverification/samplecode_numberverification.md

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,20 @@ content:
1010
the one on the SIM card installed in the end-user's device.
1111
---
1212

13-
Although the API consumption flow for this API must be always triggered from such end-user's device - therefore from the application's frontend - according to its intrinsic feature, the flow will always complete on the backend. The following code shows, for didactic purposes, a hypothetical or sample SDK used on the backend, in several programming languages, from a generic Open Gateway's channel partner, also known as aggregator.
13+
## Implementation Architecture
1414

15-
The final implementation will depend on the channel partner's development tools offering. Some of them might even provide you with both backend SDKs and frontend SDKs, the latter handling details such as network interface switching for proper mobile line identification. Apart from this extra frontend features (available upon channel partner discretion), note that channel partners' Open Gateway SDKs are just code modules wrapping authentication and API calls providing an interface in your app's programming for convenience.
15+
The Number Verification API uses a **frontend-initiated, backend-completed** authentication flow:
1616

17-
Sample code on how to consume the API without an SDK, directly with HTTP requests, is also provided, and it is common and valid no matter what your partner is, thanks to the CAMARA standardization. If you do not use an SDK you need to code the HTTP calls and additional stuff like encoding your credentials, calling authorization endpoints, handling tokens, etc. You can check our sample [Postman collection](https://github.com/Telefonica/opengateway-postman) as a reference.
17+
- **Frontend starts**: The verification request must originate from the user's mobile device to establish network identity
18+
- **Backend completes**: The authentication flow concludes on your backend server for security reasons (protecting client credentials)
19+
20+
This split architecture ensures both network-based verification and secure credential management.
21+
22+
## SDK vs HTTP Implementation
23+
24+
**Channel Partner SDKs**: Most aggregators provide SDKs that simplify authentication and API calls. Some offer both frontend and backend SDKs, with frontend SDKs handling network interface switching for proper mobile line identification.
25+
26+
**Direct HTTP Calls**: You can also consume the API directly using HTTP requests. This approach requires manual handling of credential encoding, authorization endpoints, and token management. Reference our [Postman collection](https://github.com/Telefonica/opengateway-postman) for HTTP examples.
1827

1928
> 📘 Want to give it a try before coding?
2029
> Check the [API interactive reference](https://developers.opengateway.telefonica.com/reference/phonenumberverify)
@@ -28,19 +37,31 @@ Sample code on how to consume the API without an SDK, directly with HTTP request
2837

2938
## Code samples
3039

31-
> 📘 Note
32-
> These are code samples and not finalized ready-to-run code:
33-
> - Remember to replace 'my-app-id' and 'my-app-secret' with the credentials of your app.
34-
If you registered your test app on our Sandbox, you can retrieve its credentials [here](https://sandbox.opengateway.telefonica.com/my-apps).
35-
> - Remember also to replace "aggregator/opengateway-sdk" with the SDK from your aggregator.
36-
If you are using our sandbox SDK, check info and installation of de Sandbox SDK [here](/docs/sdkreference)
40+
**Important Notes:**
41+
- Replace `my-app-id` and `my-app-secret` with your actual application credentials
42+
- If using our Sandbox, retrieve credentials [here](https://sandbox.opengateway.telefonica.com/my-apps)
43+
- Replace `aggregator/opengateway-sdk` with your aggregator's actual SDK package name
44+
- For our Sandbox SDK, check installation details [here](/docs/sdkreference)
3745

3846
### Frontend
3947

40-
This API consumption flow must always start on the end-user's device, since its feature is precisely verifying that a given phone number is the one effectively used in such device, which can be verified by the operator by receiving the online request from it:
41-
* Application's frontend performs an HTTP request to get a `code`, and provides a `redirect_uri` it wants such `code` to be redirected to.
42-
* Application's frontend will receive an HTTP redirect (status 302) and needs to be able to handle it. If it is a web application running on a web browser, the browser will natively follow the redirection. If it is not, in depends on the coding language and/or HTTP module or library used, or on its settings, how the flow will follow all the way to your application's backend through the mobile network operator authentication server.
43-
* Application's backend receives the `code` from this HTTP redirection, by publishing an endpoint in the given `redirect_uri`, and then exchanges it for an access token. The latter is achieved as shown in the [Backend](#backend) flow.
48+
#### Why the Frontend Must Initiate the Flow
49+
50+
The Number Verification API must start from the end-user's device because:
51+
- **Network Identity**: The mobile operator needs to identify which SIM card/phone number is making the request
52+
- **Device Context**: Verification works by confirming the phone number matches the device's active mobile connection
53+
- **Security**: The network-based authentication happens through the user's actual mobile data connection
54+
55+
#### Frontend Flow Steps
56+
57+
1. **Initiate Request**: Your frontend application makes an authorization request to the mobile operator
58+
2. **Provide Callback**: You specify a `redirect_uri` (your backend callback URL) where the operator will send the authorization code
59+
3. **Handle Redirect**: The mobile operator redirects to your callback URL with an authorization code
60+
4. **Backend Processing**: Your backend receives the code and completes the token exchange (see [Backend](#backend) section)
61+
62+
**Important**: The `redirect_uri` must point to your backend server, not your frontend application, because:
63+
- The authorization code must be securely exchanged for an access token using your client secret
64+
- Client secrets should never be exposed in frontend code for security reasons
4465

4566
The authentication protocol used in Open Gateway for frontend flows is the OIDC standard Authorization Code Flow. You can check the CAMARA documentation on this flow [here](https://github.com/camaraproject/IdentityAndConsentManagement/blob/release-0.1.0/documentation/CAMARA-API-access-and-user-consent.md#authorization-code-flow-frontend-flow).
4667

@@ -109,7 +130,23 @@ fetch(url, requestOptions);
109130

110131
### Backend
111132

112-
As the opposite to the flow triggering, this API consumption flow will always complete on the application's backend, since the authorization code is to be received via HTTP redirect on your redirect_uri, aka callback URL, which must be published on a web server.
133+
#### Understanding the Callback URL Requirement
134+
135+
The Number Verification API uses the OAuth 2.0 Authorization Code Flow for security purposes. Here's why a callback URL is essential:
136+
137+
**Why a callback URL is needed:**
138+
- **Security**: Your app's credentials (client secret) must remain secure and never be exposed to the frontend/browser
139+
- **Token Exchange**: The authorization code received from the mobile operator must be exchanged for an access token on your secure backend
140+
- **Network Verification**: The mobile operator needs to redirect back to your application after verifying the user's network connection
141+
142+
**How the callback URL works:**
143+
1. Your frontend initiates the verification request
144+
2. The user's device connects to the mobile operator for network-based authentication
145+
3. The operator redirects back to your `redirect_uri` (callback URL) with an authorization code
146+
4. Your backend receives this code and exchanges it securely for an access token
147+
5. The access token is then used to call the verification API
148+
149+
The callback URL must be a publicly accessible endpoint on your backend server that can handle HTTP GET requests with query parameters.
113150

114151
#### Getting the access token from the callback endpoint at the backend
115152

@@ -256,7 +293,7 @@ app.get('/numberverification-callback', (req, res) => {
256293
let accessToken
257294

258295
const myHeaders = new Headers()
259-
myHeaders.append("Content-Type", "application/x-www-form-urlencode")
296+
myHeaders.append("Content-Type", "application/x-www-form-urlencoded")
260297
myHeaders.append("Authorization", `Basic ${appCredentials}`)
261298
const requestBody = JSON.stringify({
262299
"grant_type": "authorization_code",
@@ -342,4 +379,4 @@ fetch("https://opengateway.aggregator.com/number-verification/v0/verify", reques
342379

343380
console.log(`Phone number ${verified ? "verified" : "does not match mobile line"}`)
344381
})
345-
```
382+
```

0 commit comments

Comments
 (0)