JSOM and authentication


I am developing an Outlook Addin (JavaScript). I need to also use JSOM to connect to OneDrive for Business in that addin to upload a file. I don’t know how to authenticate to use JSOM. Is there any article that can help me to authenticate from an Office Addin? Thanks