Hi,
I am the principal developer of our solution, Keluro - Smart Email Sharing, which is an add-in and a standalone Office 365 web app distributed on Office Store.
We wanted to open source a code sample that leverages all the technicalities we had to face when developing this authentication scheme. The github repository can be found at https://github.com/Keluro/Office365-AddinWeb-SignInSample
Our objective is to converge to the best solution for the Office 365 dev community and our end-users.
Best regards
Benoit Patra