Gregory GoijaertsProdigy
In our Telegram group someone suggested we added 2FA functionality to our project and we realized it'd be a great feature to add to the bunq API.
Basically what we were thinking was allowing the user to choose to turn on 2FA for an API key upon creating it in the app or while accepting a new request by scanning a QR code.
After that when a new session is created with this key the user receives a push notification which prompts the user to allow or block the request. When the user blocks the request you could also ask the user if he/she wants to deactivate the key since someone/something is trying to use their API key.
If the users accepts the request there will be a second endpoint alongside the session-server endpoint similarly to how the new tinker API endpoint ( /v1/credential-password-ip-request/{uuid} ). This endpoint would return an accepted/pending/rejected status and a session key once it gets accepted
This is extremely similar to how Google uses phone prompts which looks like this:
You could ofcourse allow the application sending the request to add a description and display the ip address of the application doing the requst among other usefull info.
Just think of the new Tap & Pay screen but with a different background color to make sure the user knows it is a different page.
Currently if someone steals my key somehow I will get a notification that someone logs in. But if that person is smart they could run a bunch of API before you can go to your settings and deactive them.
Adding this 2FA functionality would straight up block this situation while still allowing users to log-in to their favorite API projects with ease.