Verify Frontend SDK token
Verify token
Verify Frontend SDK token
Verify token
Validates user details by exchanging the token obtained from the otplessUser object for the user’s information. This server-to-server call requires authentication using the client ID and secret. Also the secureInfo details will only be included when the Secure SDK is integrated as part of the authentication implementation.
POST
/
auth
/
v1
/
validate
/
token
curl --location 'https://user-auth.otpless.app/auth/v1/validate/token' \
--header 'Content-Type: application/json' \
--header 'clientId: YOUR_CLIENT_ID' \
--header 'clientSecret: YOUR_CLIENT_SECRET' \
--data '{
"token": "RECEIVED_TOKEN_FROM_OTPLESS"
}'
{
"token": "TOKEN_VALUE",
"status": "SUCCESS",
"userId": "USER_ID",
"timestamp": "2024-10-15T14:07:14Z",
"identities": [
{
"identityType": "MOBILE",
"identityValue": "919999999999",
"channel": "OAUTH",
"methods": [
"TRUE_CALLER"
],
"verified": true,
"verifiedAt": "2024-10-15T14:07:14Z"
}
],
"network": {
"ip": "103.246.62.146",
"timezone": "Asia/Kolkata",
"ipLocation": {
"accuracyRadius": 1000,
"city": {},
"subdivisions": {},
"country": {
"code": "IN",
"name": "India"
},
"continent": {
"code": "AS"
},
"latitude": 21.9974,
"longitude": 79.0011,
"asn": {
"asn": "139570",
"name": "Spectrum Internet Services",
"network": "103.246.62.0/23"
}
}
},
"deviceInfo": {
"userAgent": "Mozilla/5.0 (Linux; Android 14; RMX3998 Build/UP1A.231005.007; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/129.0.6668.100 Mobile Safari/537.36 otplesssdk",
"platform": "Linux aarch64",
"vendor": "Google Inc.",
"browser": "Chrome",
"connection": "4g",
"language": "en-GB",
"cookieEnabled": true,
"screenWidth": 360,
"screenHeight": 800,
"screenColorDepth": 24,
"devicePixelRatio": 3,
"timezoneOffset": -330,
"cpuArchitecture": "8-core",
"fontFamily": "sans-serif",
"deviceId": "DEVICE_ID",
"browserInfo": {
"browserName": "Other",
"os": "Android",
"osVersion": "14",
"device": "Generic Smartphone"
}
},
"secureInfo": {
"incognito": false,
"confidence": {
"score": 1,
"revision": "v1.1"
},
"bot": {
"result": "notDetected"
},
"rootApps": {
"result": false
},
"emulator": {
"result": false
},
"vpn": {
"result": true,
"originCountry": "unknown",
"methods": {
"timezoneMismatch": false,
"publicVPN": true
}
},
"tampering": {
"result": false,
"anomalyScore": 0
},
"jailbroken": {
"result": false
},
"clonedApp": {
"result": false
},
"factoryReset": {
"time": "2024-10-09T10:53:31Z",
"timestamp": 1728471211
},
"frida": {
"result": false
},
"suspectScore": {
"result": 5
},
"privacySettings": {
"result": false
}
}
}
Authorizations
The clientId
used for API authentication.
The clientSecret
used for API authentication.
Body
application/json
Payload containing the token received from otpless authentication for verification.
The body is of type object
.
Response
200
application/json
The user's information was successfully retrieved.
The response is of type object
.
Was this page helpful?
curl --location 'https://user-auth.otpless.app/auth/v1/validate/token' \
--header 'Content-Type: application/json' \
--header 'clientId: YOUR_CLIENT_ID' \
--header 'clientSecret: YOUR_CLIENT_SECRET' \
--data '{
"token": "RECEIVED_TOKEN_FROM_OTPLESS"
}'
{
"token": "TOKEN_VALUE",
"status": "SUCCESS",
"userId": "USER_ID",
"timestamp": "2024-10-15T14:07:14Z",
"identities": [
{
"identityType": "MOBILE",
"identityValue": "919999999999",
"channel": "OAUTH",
"methods": [
"TRUE_CALLER"
],
"verified": true,
"verifiedAt": "2024-10-15T14:07:14Z"
}
],
"network": {
"ip": "103.246.62.146",
"timezone": "Asia/Kolkata",
"ipLocation": {
"accuracyRadius": 1000,
"city": {},
"subdivisions": {},
"country": {
"code": "IN",
"name": "India"
},
"continent": {
"code": "AS"
},
"latitude": 21.9974,
"longitude": 79.0011,
"asn": {
"asn": "139570",
"name": "Spectrum Internet Services",
"network": "103.246.62.0/23"
}
}
},
"deviceInfo": {
"userAgent": "Mozilla/5.0 (Linux; Android 14; RMX3998 Build/UP1A.231005.007; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/129.0.6668.100 Mobile Safari/537.36 otplesssdk",
"platform": "Linux aarch64",
"vendor": "Google Inc.",
"browser": "Chrome",
"connection": "4g",
"language": "en-GB",
"cookieEnabled": true,
"screenWidth": 360,
"screenHeight": 800,
"screenColorDepth": 24,
"devicePixelRatio": 3,
"timezoneOffset": -330,
"cpuArchitecture": "8-core",
"fontFamily": "sans-serif",
"deviceId": "DEVICE_ID",
"browserInfo": {
"browserName": "Other",
"os": "Android",
"osVersion": "14",
"device": "Generic Smartphone"
}
},
"secureInfo": {
"incognito": false,
"confidence": {
"score": 1,
"revision": "v1.1"
},
"bot": {
"result": "notDetected"
},
"rootApps": {
"result": false
},
"emulator": {
"result": false
},
"vpn": {
"result": true,
"originCountry": "unknown",
"methods": {
"timezoneMismatch": false,
"publicVPN": true
}
},
"tampering": {
"result": false,
"anomalyScore": 0
},
"jailbroken": {
"result": false
},
"clonedApp": {
"result": false
},
"factoryReset": {
"time": "2024-10-09T10:53:31Z",
"timestamp": 1728471211
},
"frida": {
"result": false
},
"suspectScore": {
"result": 5
},
"privacySettings": {
"result": false
}
}
}