Help users with OTPs received via SMS
Updated
¿Qué es la APIConcepto de API¿Qué es una API?Una API, siglas de Application Programming Interface o Interfaz de Programación de Apps, es un recopilatorio de código que se puede emplear para que varias apps se comuniquen entre ellas. Es algo que realiza una tarea equivalente a la interfaz de usuario al momento de promover la interacción entre persona y programa, solo que aplicado única y exclusivamente dentro del entorno del software.Aún cuando suene plus de Web OTP?
En estos días, la mayoría de las personsLas personas son personalidades imaginarias que representan a un determinado grupo objetivo. En el marketing online, las personas ayudan a entender mejor a los usuarios de un portal web o a los clientes de una tienda online. Concepto de personas Para que las personas puedan ejercer su efecto positivo, deben ser lo más detalladas viable. Esto conlleva un término exhaustiva de los grupos destinatarios para conseguir datos empíricos. La próxima plus en el mundo poseen un dispositivo móvil y los desarrolladores suelen usar números de teléfono como identificador para los usuarios de sus servicios.
Hay una variedad de formas de verificar los números de teléfono, pero una contraseña de un solo uso (OTP) generada aleatoriamente enviada por SMS¿Qué es SMS o Short Message Service?Servicio que permite el intercambio de mensajes de texto breves, de no más de 160 caracteres, entre terminales de telefonía teléfono celular, fija y otros dispositivos (su envío, por ejemplo, puede realizarse además mediante de algunas plataformas de Internet). Consiste en un sistema ampliamente consolidado, fundamentalmente entre usuarios jóvenes, quienes han desarrollado inclusive un lenguaje propio para su manejo.Acrónimo o abreviatura:SMS: Short Message Service plus es una de las más comunes. Enviar este código de vuelta al serverLos servidores son ordenadores centrales y potentes dentro del campo de la tecnología de la información que procesan y proporcionan software y archivos en una red. Desde el punto de vista de un cliente, varios ordenadores en una red pueden ponerse en contacto con el servidor central para conseguir la información solicitada. En la arquitectura cliente-servidor, el servidor puede ser un software que proporciona un servicio y se ejecuta en plus del desarrollador demuestra el control del número de teléfono.
The Web OTP API was originally called the SMS Receiver API. You may still see it by that name in some places. If you used that API, you should still read this article. There are significant differences between the current and previous versions of the API.
This idea is already implemented in many scenarios to achieve:
- Telephone number as user identifier. When signing up for a new service, some websites ask for a phone number instead of an email address and use it as an account identifier.
- Two-step verification. When you log in, a website asks for a one-time code sent by SMS in addition to a password or other knowledge factor for added security.
- Payment confirmation. When a user makes a payment, requesting a unique code sent via SMS can help verify the person's intent.
El proceso actual crea fricciones para los usuarios. Encontrar una OTP dentro de un mensaje SMS, luego copiarlo y pegarlo en el formulario es engorroso, lo que reduce las tasas de conversionConversión es una acción precisa que lleva a cabo un usuario al visitar un portal web. Algunas formas clásica de conversión son, por ejemplo, una compra, una descarga o una suscripción a la newsletter. Un parte del SEO o del Marketing Online es la Optimización de Ratio de Conversión (CRO). En el Marketing de afiliación se usa para la conversión de los editores. Información general Hay diferentes indicadores para medir plus en los recorridos críticos del usuario. Aliviar esto ha sido una solicitud de muchos de los desarrolladores globales más importantes para la web. Android tiene an API that does exactly this. It also does
ios
and
Safari.
La API Web OTP permite que su aplicación reciba mensajes con formato especial vinculados al origen de su aplicación. A partir de esto, puede obtener una OTP mediante programmingConcepto de Programación¿Qué es la Programación?La Programación es el procedimiento al que se recurre para crear algún tipo de aplicación o software, para materializar un concepto o proyecto que requiere de la utilización de un lenguaje informático para poder llevarse a cabo. Es algo que está absolutamente ligado a la figura del programador, y que cada vez está cobrando más relevancia dentro del mundo del marketing.Decimos que tanto esta figura plus a partir de un mensaje SMS y verificar un número de teléfono para el usuario más fácilmente.
Warning:
Attackers can spoof SMS and hijack a person's phone number. Operators can also recycle phone numbers for new users after closing an account. While SMS OTP is useful for verifying a phone number for the above use cases, we recommend using additional and stronger forms of authentication (such as multi-factor and the Web authentication API to establish new sessions for these users.
Actual state
The following table explains the current state of the Web OTP API.
|
He passed |
Condition |
|---|---|
|
1. Create an explainer |
To complete |
|
2. Create initial draft specification |
To complete |
|
3. Collect feedback and repeat the design |
To complete |
|
4. Proof of origin |
To complete |
| 5. Launch |
Chromium 84 |
Changes from previous versions
The first versions of this API were called SMS Receiver. If you are familiar with that version of the API, consider the changes made. SMS Receiver API enhancements include:
- The SMS message format is now aligned with WebKit.
- The web page only receives an OTP code regardless of anything else in the message.
- El código hash de la aplicación del browserUn navegador (además: browser) es una herramienta informática que te permite ver documentos y datos y navegar por la red. Los navegadores pueden mostrar distintos tipos de recursos de información; principalmente documentos HTML, a pesar de todo, además son posibles otros tipos de archivos y contenido multimedia, como PDF, JPEG, MPEG, GIF o el lenguaje de meta marcado. A través el uso de complementos especiales y la configuración respectivo, los plus ya no es necesario en el mensaje.
See it in action
Suppose a user wants to verify his phone number with a website. The website sends a text message to the user by SMS and the user enters the OTP from the message to verify the ownership of the phone number.
With the Web OTP API, these steps are as easy as one touch for the user, as shown in the video. When the text message arrives, a bottom sheet appears and asks the user to verify their phone number. After clicking the check
on the bottom sheet, the browser pastes the OTP into the form and the form is submitted without the user having to press Follow, continue.
The whole process is diagrammed in the following image.

Web OTP API Diagram
Try the demo yourself. It doesn't ask for your phone number or send an SMS to your device, but you can send one from another device by copying the text shown in the demo. This works because it doesn't matter who the sender is when using the Web OTP API.
- Go https://web-otp.glitch.me in Chrome 84 or later on an Android device.
- Send the following SMS text message to your phone from the other phone.
@ web-otp.glitch.me #12345
Did you receive the SMS and see the message to enter the code in the entry area? This is how the OTP Web API works for users.
Caution:
- If the sender's phone number is included in the recipient's contact list, this API will not be activated due to the design of the underlying. SMS user consent API.
- If you are using a work profile on your Android device and the Web OTP is not working, try installing and using Chrome on your personal profile (that is, the same profile that you receive SMS messages on).
Using the Web OTP API consists of three parts:
- A correctly annotated
label - JavaScriptJavaScript es un lenguaje de programación que funciona en el lado del cliente y con el que las webs pueden ser más funcionales. Incorporación en código HTML El código JavaScript puede ser incrustado en las páginas HTML, para que adquieran funcionalidad. Existen varias opciones. Puede estar entre las etiquetas <SCRIPT> y </SCRIPT>, puede estar contenido en un archivo externo, puede ser un parámetro de las etiquetas HTML, y puede estar plus en su aplicación web
- Formatted text message sent by SMS.
I will cover the tag first.
Write down a label
Web OTP en sí mismo funciona sin ninguna anotación HTMLHTML (Hypertext Markup Language) se usa para estructurar el contenido de texto de un documento web. No sólo se marca el contenido, sino además la meta-información que describe este contenido. Las páginas HTML se almacenan normalmente en el directorio raíz del servidor. Cómo se creó En la era digital, a los usuarios les resulta difícil hallar su camino en las webs y hacer un seguimiento de las estructuras de las plus, pero para la compatibilidad entre browsersConcepto de Navegadores¿Qué son los Navegadores?Los Navegadores son herramientas informáticas que utilizamos para, normalmente, navegar por Internet y visitar cualquier página web, al mismo tiempo de para hacer otras tareas como ver documentos, observar vídeos o reproducir contenido multimedia de cualquier tipo. Son un tipo de software sencillamente usual y bastante utilizado hoy en día.Insistimos en que es algo que se utiliza con mucha frecuencia, puesto que moverse por Internet plus, le recomiendo que agregue autocomplete = "one-time-code" to the tag where you expect the user to enter an OTP.
This allows Safari 14 or later to suggest that the user automatically complete the
field with an OTP when they receive an SMS with the format described in Format the SMS message even if it is not compatible with Web OTP.
HTML
<form>
<input autocomplete="one-time-code" required/>
<input type="submit">
</form>
Use the Web OTP API
Because Web OTP is simple, just copy and paste the following code. I'll walk you through what's going on anyway.
JavaScript
if ('OTPCredential' in window) {
window.addEventListener('DOMContentLoaded', and => {
const input = document.querySelector('input[autocomplete="one-time-code"]');
if (!input) return;
const ac = new AbortController();
const form = input.closest('form');
if (form) {
form.addEventListener('submit', and => {
ac.abort();
});
}
navigator.credentials.get({
otp: { transport:['sms'] },
signal: ac.signal
}).then(otp => {
input.value = otp.code;
if (form) form.submit();
}).catch(err => {
console.log(err);
});
});
}
Feature detection
Feature detection is the same as for many other APIs. Hear
DOMContentLoaded The eventConcepto de Evento¿Qué es un Evento?Un Evento es una actividad de carácter social que suele tener cierta proyección a nivel público y, de esta manera, suscita el interés de un determinado sector relacionado con la temática o con la razón por el que se celebra. Es un tipo de acto que suele tener mucha repercusión a nivel empresarial.Podemos hallar distintos tipos de eventos, desde los deportivos hasta los empresariales, pasando plus esperará a que el árbol DOM esté listo para realizar consultas.
JavaScript
if ('OTPCredential' in window) {
window.addEventListener('DOMContentLoaded', and => {
const input = document.querySelector('input[autocomplete="one-time-code"]');
if (!input) return;
…
const form = input.closest('form');
…
});
}
Caution:
La API Web OTP requiere un origen seguro (HTTPSHTTPS (protocolo de Transferencia de Hiper-Texto) es un protocolo que permite determinar una conexión segura entre el servidor y el cliente, que no puede ser interceptada por personas no autorizadas. En resumidas cuentas, es la versión segura de el http (Hyper Text Transfer Protocol) Cómo funciona Una conexión HTTP estándar en Internet puede ser fácilmente secuestrada por partes no autorizadas. El propósito de una conexión HTTPS es evitar esto: encriptar plus). La detección de funciones en un sitio web HTTPEl HTTP (Hyper Text Transfer Protocol) es un protocolo que se usa para transmitir datos en redes. HTTP es un estándar técnico generalmente aceptado que establece cómo un cliente web se comunica con un servidor para que los datos solicitados por el cliente puedan ser cargados y mostrados. Información general Junto con el URL y el HTML, HTTP es uno de los conceptos más importantes de Internet (www). Fue desarrollado plus fallará.
Process the OTP
The Web OTP API itself is pretty simple. Use
navigator.credentials.get ()
to get the OTP. Web OTP adds a new otp option to that method. It only has one property: transport, whose value must be an array with the string 'sms'.
JavaScript
…
navigator.credentials.get({
otp: { transport:['sms'] }
…
}).then(otp => {
…
This activates the browser permission flow when an SMS message arrives. If permission is granted, the returned promise is resolved with a OTPCredential object.
ContentEl contenido puede ser muy difícil de definir con precisión. Es una definición que se refiere a las declaraciones contenidas en un documento o publicación de cualquier tipo y puede incluir las tecnologías de la información y la comunicación. Esto cubre todos los tipos de medios como imágenes y texto. A parte de esto, en el campo de la optimización de motores de búsqueda, los términos duplicar contenido, contenido único, plus de obtenido OTPCredential object
{
code: "123456"
type: "otp"
}
Then pass the OTP value to field. Submitting the form directly will eliminate the step that requires the user to tap a button.
JavaScript
…
navigator.credentials.get({
otp: { transport:['sms'] }
…
}).then(otp => {
input.value = otp.code;
if (form) form.submit();
}).catch(err => {
console.error(err);
});
…
Abort the message
In case the user manually enters an OTP and submits the form, they can cancel the
get () call using a AbortController instance in the options
object.
JavaScript
…
const ac = new AbortController();
…
if (form) {
form.addEventListener('submit', and => {
ac.abort();
});
}
…
navigator.credentials.get({
otp: { transport:['sms'] },
signal: ac.signal
}).then(otp => {
…
Format the SMS message
The API itself should seem simple enough, but there are a few things to know before using it. The message must be sent after
navigator.credentials.get () is called and must be received on the device where get () was called. Finally, the message must adhere to the following format:
- El mensaje comienza con texto legible por humanos (opcional) dejando la última línea para la UrlEl URL (Localizador Uniforme de Recursos), es una dirección definida que apunta a la posición de un archivo en un servidor y lo recupera. Las URL se introducen en un navegador web para ingresar a documentos en la web o se incrustan como hipervínculos dentro de un documento. Se puede usar un Permalink para que una URL esté disponible de forma permanente. Componentes de una URL • prefijo de protocolo plus y la OTP.
- The host part of the website URL that invoked the API must be preceded by
@. - The URL must contain a pound sign ('
#') followed by the OTP.
For example:
Your OTP is: 123456.@www.example.com #123456
Population
Try various messages with the demo:
https://web-otp.glitch.me
You can also fork it and create your version:
https://glitch.com/edit/#!/web-otp.
Frequently asked questions
Where do I report errors in the Chrome deployment?
Found a bug with the Chrome implementation?
- File a bug in
https://new.crbug.com. Include as much detail as you can, simple instructions to reproduce and set up Components toBlink> WebOTP.
How can I help with this feature?
¿Está pensando en utilizar la API de Web OTP? Su apoyo público nos ayuda a priorizar las funciones y muestra a otros proveedores de navegadores lo importante que es darles soporte. Enviar un tweetUn tweet es un mensaje corto que puede ser enviado por medio de del servicio de microblogging Twitter. ¿Qué es un tweet? Un tweet es un mensaje de estado en Twitter que puede tener hasta 280 caracteres. Los tweets solían limitarse a 140 caracteres, pero esta cantidad se incrementó a 280 en septiembre de 2017. Debido al espacio limitado para el texto, las URLs para uso en tweets son normalmente plus to @Cromodev with
#webotp and let us know where and how you are using it.
What are the differences with the SMS receiver API?
Think of the Web OTP API as an evolved version of the SMS Receiver API. The OTP Web API has some significant differences compared to the SMS Receiver API.
- The expected text format for the SMS message has changed.
- It no longer requires an application hash string to be included in the SMS message.
- The called method is now
navigator.credentials.get ()rather than
navigator.sms.receive (). - the
get ()receive only the OTP instead of the whole SMS message like
receive ()did before. - It is now possible to abort the call to
get ().
Is this API compatible with different browsers?
Chromium and WebKit agreed the SMS text message format and Apple announced Safari support for it starting with iOS 14 and macOS Big Sur. Although Safari does not support the Web OTP JavaScript API, when annotating input element with autocomplete = ["one-time-code"], the default keyboard automatically suggests that you enter the OTP if the SMS message conforms to the format.
Is it safe to use SMS as a form of authentication?
While SMS OTP is useful for verifying a phone number when it is first provided, phone number verification via SMS should be used carefully to re-authenticate as operators can hijack and recycle phone numbers . Web OTP is a convenient recovery and restoration mechanism, but services must combine it with additional factors, such as a knowledge challenge, or use the
Web authentication API
for strong authentication.




