如何使用javascript连接到经典asp中的第三方网站进行密码加密但不提供密码
我必须对经典的 asp 网站进行更改,一旦单击按钮,它就会自动登录到第三方网站,并带有一个中间页面,警告您正在登录到第三方网站。
第三方向我们提供了用户名和密码,并给了我们一个 JavaScript 示例来对密码进行编码以发送给他们。现在我在哪里存储用户名和密码。我无法在服务器端执行 JavaScript。它必须交给客户。如果带有加密javascript的asp页面转到客户端,则可以查看源代码并给出用户名和密码。
有没有一种方法可以隐藏 asp 页面,其唯一的工作就是加密密码并创建一个新的 url 并自动将其重定向到该新的 url。
因此,当用户在中间警告页面上单击“确定”时,我将其重定向到此隐藏的 asp 页面,该页面进行加密并为 get 方法创建一个 url 并重定向到该页面。
就java脚本和经典asp而言,我是一个新手。任何想法/建议将不胜感激。
谢谢,
--阿比
I have to make changes to classic asp website where once a button is clicked it autologins to a third party website with a intermediate page that warns that you are logging in to a third party website.
The thirdparty is providing us with a username and password and gave us an examle javascript to encode the password to send to them. Now where do I store the userid and password. I cannot execute the javascript on the serverside. It has to go to the client. If the asp page which has the encryption javascript goes to the client side then the source can be viewed and the username and password is given out.
Is there a way that I can have hidden asp page whose only job is to encrypt the password and create a new url and auto redirect it to that new url.
So when the user clicks ok on the intermediate warning page I redirect it to this hidden asp page which does the encryption and a creates a url for get method and redirects to that page.
I am a novice as far as java script and classic asp is concerned. Any ideas/ advice will be appreciated.
Thanks,
--Abbi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如 SLaks 所说,你做什么并不重要,如果客户端浏览器必须将用户/通行证发送到最终网站,那么你无法阻止该客户端浏览器看到该用户/通行证。它必须看到它,才能将其提供给其他网站。
您可能需要考虑的是创建一个在服务器端加载并从您的网站呈现给客户端浏览器的页面。想想 iframe(但不是 iframe,它仍然是客户端);您的服务器从目标服务器请求页面,然后将该页面呈现回浏览器。根据该页面上发生的交互类型,这可能会变得非常复杂;您基本上需要代理服务器和目标站点之间的所有 GET 和 POST。但这将消除向浏览器提供用户名和密码的需要。
As SLaks said, it really doesn't matter what you do, if the client browser MUST send the user/pass to the final website, then you cannot prevent that client browser from being able to see that user/pass. It MUST see it, in order to provide it to the other website.
What you might want to consider is creating a page that is loaded server side and presented to the client browser from your website. Think iframe (but not an iframe, that's still client side); where your server requests the page from the destination server, and then presents that page back to the browser. This could get very complex depending on the kinds of interactions that happen on that page; you would basically need to proxy all GET's and POST's between your server and the destination site. But this would eliminate the need for giving the browser the username and password.