TwoFactorAuth
TwoFactorAuth copied to clipboard
Image support for FreeOTP
Feature added
Added Image support for FreeOPT as explained on this StackOverflow answer: https://stackoverflow.com/a/50410063
Feature test
Feature tested on FreeOTP and works as expected. Also tested on Microsoft Authenticator, Authy and Google Authenticator to check that still works on authenticators that do not suport the image parameter.
Test were made on Android versions only
This seems to be an application-specific deviation from the official spec so I'd vote against including it here, pending any official change to the spec.
The implementation of #56 provides the capability to the individual developers application without affecting the core of the library so is less responsibility to the library as a whole than this change.
An option would be to refactor out something like an IUriGenerator or something with a default implementation that could be extended by inheritance or even completely replaced with another implementation. But, to be totally honest, I think that's waaaay overengineering a solution. OTOH I do understand the desire for a logo/image. I'm on the fence about this one.
Thing is; even if the extra parameter is added, it doesn't break any other authenticators (does it? - we'll need to verify this at least for the top 5 or so most popular ones). And as long as no image is set the parameter won't be added to the url. So I also don't see any harm other than 'promoting' use of non-standard extensions. Then again, that's what made the internet the internet; if everyone had stuck with the spec we'd still be in the early 2000's by web-standards...
For now I vote to be on the conservative reserved side and keep it out. For now.