admin管理员组文章数量:1389978
I'm looking for the correct, secure way to store credentials for a third party API in an Outlook add-in. This overview of the different storage options only says not to store credentials in Settings, but not where to put them, so I assumed the RoamingSettings would be okay. Then I ran into this page with information about RoamingSettings, where it says that is not the right location either.
The question then bees: What is the right place? Should I build my own storage solution and store/encrypt the credentials in a file or cookie? That does not feel very secure either, since we are talking about what is basically a web app running in an Iframe.
I'm looking for the correct, secure way to store credentials for a third party API in an Outlook add-in. This overview of the different storage options only says not to store credentials in Settings, but not where to put them, so I assumed the RoamingSettings would be okay. Then I ran into this page with information about RoamingSettings, where it says that is not the right location either.
The question then bees: What is the right place? Should I build my own storage solution and store/encrypt the credentials in a file or cookie? That does not feel very secure either, since we are talking about what is basically a web app running in an Iframe.
Share Improve this question edited Jan 29, 2016 at 16:41 Dmitry Streblechenko 66.5k4 gold badges55 silver badges83 bronze badges asked Jan 29, 2016 at 10:21 nforssnforss 1,2581 gold badge17 silver badges32 bronze badges 5- Can you tell us more about the "third party" API. When you say "third party" I suppose that this not your web app that serves the add-in neither a Microsoft apis (EWS, outlook apis, office365 etc.), correct? How this api secure? Except if it supports only basic authentication, you could be able to retrieve some kind of token or authorization codes that you will have to keep which is far more secure than keeping raw credentials. – Benoit Patra Commented Jan 29, 2016 at 12:56
- You are right that "third party" is perhaps the wrong term. I am referring to our own web API, for which the Outlook add-in is being built. A way to access the service from within Outlook. – nforss Commented Jan 29, 2016 at 16:27
- And the API uses Basic authentication (over SSL). – nforss Commented Jan 29, 2016 at 16:28
- Did you manage to find a solution? – Benoit Patra Commented Feb 4, 2016 at 11:44
- I used HTML 5 local storage, as you suggested, and it seems to be working fine. I'll mark that response as the correct answer. Thank you! – nforss Commented Feb 7, 2016 at 17:04
2 Answers
Reset to default 3I assume you cannot implement another authorization scheme (token based, cookies etc.) for your API and you are stuck with Basic Authentication and its issues. If you are using ASP.NET, with all the samples available it could be very easy to add another authentication scheme that is more adapted to web clients (such as Office web add-ins).
Having said that, for me your best option is to use HTML5 storage or cookie storage (if not implemented by browser) to store your credentials.
The fact that the app is iFramed is not really a big deal. Those storages (HTML5: sessionStorage/localStorage) rely on domains separation which means that the storage slots where you will put the credentials will not be be visible by other apps, even those living on the parent iFrame.
You may also consider the fact that you may serve the web add-ins and the apis from the same domain. They are both web applications!
You can do what Outlook itself does for its POP3/SMTP/IMAP4 passwords - use CredRead / CredWrite Windows API functions. The data can only be decrypted under the local Windows account used to encrypt the data, so it cannot be take to a different machine and decrypted.
I don't think you can access these functions from JavaScript. This is for an OWA addin, not the Outlook application, is it?
本文标签: javascriptHow to store credentials in an Outlook AddinStack Overflow
版权声明:本文标题:javascript - How to store credentials in an Outlook Add-in - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744746310a2622900.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论