在桌面应用程序中存储客户端ID和密码的位置? [英] Where to store client id and secret code in a desktop application?

查看:522
本文介绍了在桌面应用程序中存储客户端ID和密码的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的免费翻译帐户的许可条款说我永远不必公开我的客户ID和密码。

The license terms of my free translator account say that I never have to expose my client id and secret code.

但是如果我有桌面.Net应用程序并且想要使用我遇到以下问题的服务:

But if I have a desktop .Net application and want to use the service I run into the following problems:

- 这是一个桌面应用程序,所以任何人都可以使用二进制文件并调用translate方法,即使没有明确知道秘密。

- It's a desktop app, so anyone could use the binaries and call the translate method, even without explicitly knowing the secret.

- 这是.Net,所以每个人都可以反编译二进制文件并阅读代码以找到秘密(我已经在其他应用程序中看到了这一点)。

- It's .Net, so everyone can decompile the binaries and read the code to find the secret (I've already seen this in other apps).

如何在不泄露我的秘密的情况下在桌面应用中使用翻译服务?

How can I use the translation service in a desktop app without exposing my secret?

推荐答案

嗨Tom,

保密的唯一方法就是不存储它。在客户端。

the only way to keep it secret is to not store it. On the client.

我们建议仅在服务器上存储客户端ID和密码。您的服务器从Azure Access Control服务获取访问令牌,并将返回的令牌交给经过身份验证的客户端 - 您知道的客户端是您的客户端。该令牌仅对
有效10分钟。

We recommend to store the client ID and secret on the server only. Your server obtains the access token from the Azure Access Control service, and hands the returned token to an authenticated client - a client that you know is yours. the token is valid for 10 minutes only.

在连接上使用SSL,使得在传输中窃取令牌变得更加困难。

Use SSL on the connection, making it harder to steal the token in transit.

您的Microsoft翻译团队,显然落后于时间2。2年。

Your Microsoft Translator team, apparently 2 1/2 years behind the times.


这篇关于在桌面应用程序中存储客户端ID和密码的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆