Giter Site home page Giter Site logo

Comments (3)

samuelgoto avatar samuelgoto commented on July 24, 2024

The only extension point that I can think off of the top of my head is in terms of transport mechanisms. So something like this would suffice:

navigator.credentials.get({otp: {transport: ["sms"]}}).then((credentials) => {
    // .... 
});

It also leaves the door open to other things in case we need. It is also consistent with the WebAuthn API, so kinda of nice. Open to other extensibility points too.

from web-otp.

mikewest avatar mikewest commented on July 24, 2024

Would you expect the user agent to do anything different based on the transport types provided to the user? I assume we'd be relying on an underlying platform-exposed API that handled some set of transports, but I can imagine the user agent might render different UX depending on the options available?

For the OTPCredentialRequestOptions, I think I'd suggest erring on the side of something extensible to give yourself options in the future. Treating it as a dictionary with a single transport member sounds fine to me.

(I'd note, though, that you'll likely want to expose in some way (perhaps a static transports attribute on OTPCredential?) whether or not a specific set of transports is available so that developers know how they can send an OTP. (And you'll need to think about the fingerprinting surface that exposes.))

from web-otp.

samuelgoto avatar samuelgoto commented on July 24, 2024

Would you expect the user agent to do anything different based on the transport types provided to the user? I assume we'd be relying on an underlying platform-exposed API that handled some set of transports, but I can imagine the user agent might render different UX depending on the options available?

Yes. Listening to SMS messages isn't free (e.g. it creates a Task<> on Android), so if we were expecting an "OTP by email" we wouldn't want to kick off the SMS retrieval process.

For the OTPCredentialRequestOptions, I think I'd suggest erring on the side of something extensible to give yourself options in the future. Treating it as a dictionary with a single transport member sounds fine to me.

SGTM.

from web-otp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.