Firesphere / silverstripe-bootstrapmfa

Bootstrap your MultiFactor with backup codes and a ready-to-go second-factor authentication
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

Store MFA registrations as a hasMany relationship #56

Open ScopeyNZ opened 5 years ago

ScopeyNZ commented 5 years ago

Currently multiple MFA types are supported on a Member. This is done by requiring each MFA type to define a MemberExtension. In my opinion this is a confusing and difficult to manage way of storing MFA registrations for a Member. To simply get a count of MFA methods you will have to somehow grab each MFA method in the codebase and run through each to ask whether that MFA method is set up against a member.

I propose that we introduce a MFAMethod DataObject that belongs to Member that stores this detail instead. MFA modules can write a DataExtension for that object or we could just provide a JSON blob field that can store arbitrary data for an MFA method.

This should also make it simpler to write authentication methods in the future.