Android has automatic and one-tap SMS verification. We would like to cover the gap on web platform and implement the WebOTP Service API for web developers.
This is implemented in third_party/blink/renderer/modules/credentialmanagement and exposes the following function:
navigator.credentials.get({otp: {transport: ["sms"]}})
- Unit tests are located in content/browser/sms/webotp_service_unittest.cc.
- Browser tests are located in content/browser/sms/sms_browsertest.cc.
- The Android related tests are located in chrome/android/javatests/src/org/chromium/chrome/browser/sms/.
- Web platform tests are located in third_party/blink/web_tests/http/tests/credentialmanagement/
For how to run these tests, refer to Chromium documentation Running tests locally, Android Test Instructions
For testing this API locally, refer to How to use the Web OTP API
The Android implementation (this does not include Android WebView) is located in chrome/browser/ui/android/sms/, content/public/android/java/src/org/chromium/content/browser/sms/, and chrome/android/java/src/org/chromium/chrome/browser/sms/.
For architectural diagrams, refer to design doc.
We plan to implement it in the near future.