1. Auth and Qr identification
RSID docs
English
  • English
  • Russian
  • Uzbek
  • Integration Overview
  • Web SDK
    • Usage guide
    • sign-in
      POST
    • refresh
      POST
    • create-session
      POST
    • user-info
      GET
  • Mobile SDK
    • Usage guide
    • sign-in
      POST
    • refresh
      POST
    • create-session
      POST
    • user
      GET
  • Backend with information
    • Usage guide
    • sign-in
      POST
    • refresh
      POST
    • Option 1 — compare photo with passport photo
      POST
    • Option 2 — compare two photos with citizen data
      POST
    • Option 3 — compare two photos without citizen data
      POST
    • Get result
      GET
  • Backend without information
    • Usage guide
    • sign-in
    • refresh
    • Option 1 — compare photo with passport photo
    • Option 2 — compare two photos with citizen data
    • Option 3 — compare two photos without citizen data
  • Auth and Qr identification
    • Sign with RS-ID (Oauth2 style)
    • Qr Sign/Identification process
    • Get user info by code
      POST
    • sign-in
      POST
    • refresh
      POST
    • Create a QR token
      POST
    • Get QR token status by qr_id
      GET
    • Get QR token status by external_id
      GET
  • Schemas
    • ErrorResponse
    • AuthCodeRequest
    • ClientCredentials
    • Token
    • UserInfo
    • TokenResponseEnvelope
    • DocumentInfo
    • Signer
    • StringResponseEnvelope
    • ContactInfo
    • CallbackEvent
    • UserProfile
    • QrTokenCreateRequest
    • PhotoItem
    • Address
    • UserProfileResponseEnvelope
    • AdditionalParams
    • WebSessionCreateRequest
    • QrToken
    • UserProfileResponse
    • CompareFaceRequest
    • UserResponseEnvelope
    • CompareImagesWithInfoRequest
    • QrTokenResponseEnvelope
    • CompareImagesRequest
    • SignCallback
    • ComparisonResult
    • MobileSessionCreateRequest
    • ComparisonResultEnvelope
  1. Auth and Qr identification

Sign with RS-ID (Oauth2 style)

1. What is Sign in with RS-ID#

Sign in with RS-ID lets users log in to your website with their RS-ID mobile app, instead of a password. It follows the standard OAuth 2.0 Authorization Code flow.
Your site sends the user to the RS-ID auth page. The page shows a QR code; the user scans it with the RS-ID mobile app and confirms their identity with their face. RS-ID then sends the user back to your site with a one-time authorization code, and your backend exchanges that code for the user's verified profile.
You never handle passwords, passport data entry or face checks — RS-ID does it, and your backend gets a verified identity.

Use cases#

Use caseExample
Passwordless loginUsers sign in to your web portal by scanning a QR code with the RS-ID app.
Verified registrationA new user signs up in one step; your account is created with verified name, PINFL and document data.
Login for sensitive servicesBanking, insurance, government or medical portals that need a real, verified person at every login.
Single identity across servicesThe same RS-ID identity is used to sign in to several of your products.

2. Terminology#

TermWho / what it is
ClientThe company integrating RS-ID (you). Registered in RS-ID as an AUTH project and issued a client_id / client_secret and a registered redirect_uri. Includes the client frontend (your website) and the client backend.
UserThe person signing in — your customer, who has the RS-ID mobile app.
RS-ID auth pageThe RS-ID web page where the user scans the QR code.
RS-ID mobile appThe RS-ID app on the user's phone, used to scan the QR code and confirm identity.
ServerThe RS-ID server that issues authorization codes and returns the user profile.
Authorization code (code)A one-time code RS-ID sends to your redirect_uri after the user signs in. Valid for 5 minutes, usable once.
redirect_uriThe URL on your site where RS-ID sends the user back with the code. Must be registered in RS-ID.
stateA random value your site generates for each login and checks on return, to protect against CSRF.
PINFLPersonal identification number of an individual — 14 digits.

3. How it works#

1.
The user clicks Sign in with RS-ID on your site.
2.
Your site redirects the user to the RS-ID auth page with client_id, redirect_uri, response_type=code and state (7.1).
3.
The auth page shows a QR code that refreshes every 30 seconds (7.2).
4.
The user scans the QR code with the RS-ID mobile app and confirms their identity.
5.
The auth page redirects the user to your redirect_uri with code and state (7.3).
6.
Your backend checks state and exchanges the code for the user's profile with POST /v1/user/by-code (7.4).
7.
You sign the user in to your system.

4. Integration diagram#

integration-flow-oauth2.png

5. Environments#

EnvironmentRS-ID auth pageAPI base URL
Stage (testing)https://auth.stage.rsid.uzhttps://sdk.stage.rsid.uz/web/api
Productionhttps://auth.rsid.uzhttps://sdk.rsid.uz/web/api
Stage and production use different client_id / client_secret. The redirect_uri is registered separately for each environment.

6. General rules#

Response envelope#

Every API response has the same structure:
{ "data": { }, "code": 0, "message": "Success" }
FieldTypeDescription
codeinteger0 — success. Any other value is an error (see the error tables). Always check code, not only the HTTP status.
messagestringHuman-readable text in the request language (uz / ru / en). Do not parse it.
dataanyResponse payload. Absent on errors.

Security#

client_secret stays on your backend. Never put it into the browser or a mobile app. Exchange the code only from your backend.
Always use and check state. Generate a new random state for each login, keep it in the user's session, and reject the return if it does not match.
The code is one-time and short-lived. Exchange it right away — it is valid for 5 minutes and can be used only once.
Use HTTPS for your redirect_uri.

7. API definitions#

7.1 Redirect the user to the RS-ID auth page#

Your site sends the user's browser to the RS-ID auth page.
Method - GET (browser redirect)
URL - {auth_page_url}/
Query parameters
FieldTypeRequiredLength / formatDescription
client_idstringYes—Your client_id issued by RS-ID.
redirect_uristringYesURL, URL-encodedWhere RS-ID sends the user back. Must exactly match the redirect_uri registered in RS-ID.
response_typestringYescodeAlways code (authorization code flow).
statestringRecommendedRandom stringRandom value generated by your site for this login. Returned unchanged with the code.
Example
https://auth.rsid.uz/?client_id=shop-example-auth&redirect_uri=https%3A%2F%2Fshop.example.uz%2Fauth%2Frsid%2Fcallback&response_type=code&state=Zx81kQ2mP0

7.2 User flow on the RS-ID auth page#

1.
The auth page shows a QR code. For security, the QR code is regenerated every 30 seconds — an old QR code cannot be used.
2.
The user opens the RS-ID mobile app and scans the QR code.
3.
The user confirms their identity in the app (face check).
4.
When identification succeeds, the auth page redirects the user back to your site (7.3).
If the user closes the page or does not scan in time, nothing is sent to your site; the user can start again from 7.1.

7.3 Redirect back to your site with the code#

After a successful sign-in, the RS-ID auth page redirects the user's browser to your redirect_uri:
https://shop.example.uz/auth/rsid/callback?code=Zx81kQ2mP0aB7cD9eF1gH3&state=Zx81kQ2mP0
ParameterDescription
codeOne-time authorization code. Valid for 5 minutes, usable once.
stateThe value you sent in 7.1. Compare it with the one saved in the user's session; if it differs, stop the login.
Your callback page passes code (and state) to your backend, which calls 7.4.

7.4 Get user info by code#

The client backend exchanges the authorization code for the user's verified profile.
Method - POST
Endpoint - {base_url}/v1/user/by-code — no Authorization header
Content-Type (Headers) - application/json

Request body
FieldTypeRequiredLength / formatDescription
client_idstringYesNon-emptyYour client_id (AUTH project).
client_secretstringYesNon-emptyYour client_secret.
codestringYesNon-emptyThe code from 7.3.
grant_typestringYesauthorization_codeAlways authorization_code.
{
  "client_id": "shop-example-auth",
  "client_secret": "s3cr3t-value",
  "code": "Zx81kQ2mP0aB7cD9eF1gH3",
  "grant_type": "authorization_code"
}
Response
FieldTypeDescription
data.user_info.first_namestringFirst name.
data.user_info.last_namestringLast name.
data.user_info.middle_namestringPatronymic. - if the person has none.
data.user_info.pinflstringPINFL, 14 digits. Use it as the stable user identifier.
data.user_info.genderstringGender.
data.user_info.birth_datestringyyyy-MM-dd.
data.user_info.birth_placestringPlace of birth.
data.document_info.documentstringDocument series and number.
data.document_info.typestringDocument type.
data.document_info.issued_bystringIssuing authority.
data.document_info.issued_atstringIssue date, yyyy-MM-dd.
data.document_info.expiry_atstringExpiry date, yyyy-MM-dd.
data.contact_info.phonestringPhone number from the RS-ID account.
data.contact_info.emailstringEmail from the RS-ID account, if set.
data.permanent_addressobjectNot returned in this flow (null).
data.temporary_addressobjectNot returned in this flow (null).
codeinteger0 on success.
messagestringResult text.
{
  "data": {
    "user_info": {
      "first_name": "ALISHER",
      "last_name": "KARIMOV",
      "middle_name": "BAXTIYOROVICH",
      "pinfl": "12345678901234",
      "gender": "MALE",
      "birth_date": "1990-01-01",
      "birth_place": "TOSHKENT",
      "birth_country": null,
      "nationality": null,
      "citizenship": null
    },
    "document_info": {
      "document": "AA1234567",
      "type": "PASSPORT",
      "issued_by": "IIV 26283",
      "issued_at": "2018-05-10",
      "expiry_at": "2028-05-09"
    },
    "contact_info": {
      "phone": "998901234567",
      "email": "alisher.karimov@example.uz"
    },
    "permanent_address": null,
    "temporary_address": null
  },
  "code": 0,
  "message": "Success"
}
Errors
CodeReason
-1083client_id not found.
-1002The client is not an AUTH project.
-1089grant_type is not authorization_code.
-1018code is invalid, expired (older than 5 minutes) or already used, or client_secret is wrong. Start the login again from 7.1.
-1035code is not linked to a sign-in. Start the login again from 7.1.
400A required field is empty.

8. Error codes#

CodeNameMeaning
0SUCCESSSuccess.
-9SYSTEM_ERRORUnexpected server error.
-1002CLIENT_NOT_PERMITTEDThe client is not an AUTH project.
-1018USER_NOT_FOUNDCode invalid, expired or already used, or wrong credentials.
-1035INVALID_QR_TOKENCode is not linked to a sign-in.
-1083CLIENT_PROJECT_NOT_FOUNDclient_id not found.
-1089INVALID_GRAND_TYPEgrant_type is not authorization_code.
Modified at 2026-11-09 12:44:03
Previous
Option 3 — compare two photos without citizen data
Next
Qr Sign/Identification process
Built with