EDIT: this approach is outdated. You can have a look at the sample we released and especially in the README section we compare the different approaches https://github.com/Keluro/Office365-AddinWeb-SignInSample