Giter Site home page Giter Site logo

spring-security-otp-test's People

Contributors

upcrob avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

mark-mngoma

spring-security-otp-test's Issues

Sample allows for abuse

Hi!

I'm sure you didn't expect an issue :)

Right now pressing the 'send/generate OTP' button only sends the username, by which the email (or sms) is retrieved.

This allows for easy abuse, someone with just the username of someone would be able to spam them with many OTP mails (or worse, SMS'es, costly!).

I'm trying to set up something similar, but I chose to use two filters, and a temporary ROLE:

  1. First filter authenticates on username + password.
  2. This also generates and sends the OTP, but only if the password is correct, this makes it a lot harde to abuse.
  3. The user now must enter the OTP, which is sent to a second filter, which for a valid OTP updates the roles of the user to the permissions belonging to the user.

Doing things this way seems safer. But admittedly I'm still struggling to get everything right :) Especially what to do in the seconds step, like which Token to use (a OTP token? but then the usernamepassword token is gone), what to do with principal (keep the principal from the first authentication, or get a new principal from the db?), the details (Keep the original WebAuthenticationDetails, or create a new one?).

A proper multi factor authentication library, or Spring security support, would be awesome, so keep it up ;)

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.