The translation was generated automatically and may contain mistakes
The Interaction Scenario
The article describes the scheme and order of interaction of your web application with VK ID Captcha SDK Web and API VKontakte
How to install and connect VK ID Captcha SDK for web platform, see WEB instructions .
Interaction scheme
Interaction scheme with VK ID Captcha SDK Web
Order of interaction
- 1.Web App install and connect VK ID Captcha SDK Web.
- 2.Web App integrates the captcha error handler to the Web API response handler.
- 3.The API request is VKontakte>
- 4.
- 5.The VKontakte API returns a web application captcha Error with code
error_code: 14, the messageerror_msg: "Captcha needed"and a reference to initialize the captcha session in the fieldredirect_uri. - 6.The web application sends a request to the VK ID Captcha SDK Web to display the captcha using the method
captchaWidget.show(). - 7.The Captcha SDK Web VK ID sends a captcha display request to the Captcha iframe.
- 8.The user passes the captcha.
- 9.The API VKontakte analyzes user actions. Depending on the result, options are possible:
- •Successful scenario: the user is a person who has passed the captcha.
- 1.The VKontakte API creates a captcha success token
success_tokenand passes it to the Captcha iframe. - 2.Captcha iframe transmits
success_tokenVK ID Captcha SDK Web. - 3.Depending on the type of captcha display
view, the Captcha iframe does one of the following:- •Closes the captcha if it is displayed as a pop-up window (
view = popup). - •Leaves the captcha on the page if it is displayed as a block (
view = block).
You can set the captcha to close manually with the methodcaptchaWidget.close().
- •
- 4.VK ID Captcha SDK Web returns a promise to your web application with
success_token. - 5.The web application sends the API VKontakte a re-request (step 1), in response to which the captcha error returned. In the request you need to pass
success_tokenwith the received token value.
- 1.
- •Failed scenario: the user is a bot.
- 1.The VKontakte API sends an error to the Captcha iframe.
- 2.The user is blocked. A rerun of the captcha is only possible during a new session.
- 1.
- •Unsuccessful scenario: the user closed the captcha window.
- 1.The VKontakte API returns an error to the Captcha iframe.
- 2.The Captcha iframe returns a Captcha SDK Web error to the VK ID.
- 3.VK ID Captcha SDK Web returns a promise with an error
error = close.
- 1.
- •
- 10.The web application displays the result of the captcha to the user.