在外部站点中自动进行字段输入

发布于 2024-09-02 17:15:42 字数 499 浏览 1 评论 0原文

我正在尝试将数据自动输入表单字段。问题是用户不知道该数据(用户/通行证)。我并没有明确向他们隐瞒,但他们也不需要知道。

这用于自动登录我们的几个外部合作伙伴网站,这些网站不希望我们的代理知道他们的密码。遗憾的是,大多数这些网站没有任何我可以使用的 API...所以我必须让用户登录。

我尝试使用 iframe 和 javascript,但遇到了拒绝其访问的安全权限问题。遗憾的是,我们的客户无权将我们的域名添加到他们的网站(他们似乎是第三方)。

要求: - 显示网页 - 自动将数据输入字段

会很好: - 类似于 form.submit() 自动登录 - Flash/AJAX 支持。这些似乎给 VB 应用程序带来了问题。

有没有办法通过 javascript/html 来做到这一点,如果没有,您对 C#/php/asp.net 选项有什么建议吗?

PS:我不确定这种技术叫什么,所以谷歌似乎没有帮助我。请让我直接了解我实际上想要完成的任务的术语。

I am attempting to automate the entry of data into form fields. The problem is that this data (user/pass) is not known by the user. I'm not expressly hiding it from them, but they also don't need to know it.

This is used to automate logins on several of our outside partner websites, who do not want our agents knowing their passwords. Sadly, most of these sites do not have any APIs I can work with... so I have to get the user logged in.

I tried using an iframe and javascript, but I ran into the issue of security permissions denying it access. And sadly, our clients do not have access to add our domain to their sites(they seem to be 3rd party).

Requirements:
- Display webpage
- Automatically enter data into fields

Would be nice:
- Automate signin similar to form.submit()
- Flash/AJAX support. These seem to give the VB app issues.

Is there a way to do this via javascript/html, and if not, do you have any recommendations for C#/php/asp.net options?

PS: I am not sure what this techinque is called, so google isn't helping me it seems. Please set me straight on the terminology of what I am actually trying to accomplish.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

凡尘雨 2024-09-09 17:15:43

您最好的选择可能是为相关应用程序构建代理。您的 C# 代码应该从远程服务器请求 URL(发送任何 postdata),然后向您的用户显示结果。这样,您的用户就可以与您正在构建的代理应用程序进行交互,然后您可以使用 JavaScript 操作页面,甚至服务器端也可以执行诸如替换

之类的操作。

Your best bet here might be to build a proxy to the applications in question. Your C# code should request the URL from the remote server (sending any postdata) and then display the result to your users. That way, your users interact with the proxy app you're building and you can then manipulate the pages using JavaScript, and even server side do things like replacing

<input type="text" name="username">

with

<input type="hidden" name="username" value="some-user">

拥醉 2024-09-09 17:15:43

如果您向他们发送唯一 ID(链接到特定用户)而不是他们用于登录的用户名和密码,会怎么样?这样,如果您不知道密钥,并且这些用户不知道他们的实际用户名/密码,那么对于外部单词来说,它是“安全的”。

类似于:http://yourdomain.com/login.php?key=12345ABCD678
或者更好,使用 mod_rewritehttp://yourdomain.com/login/12345ABCD678

在您的登录脚本中,$_GET 该 ID,使用您选择的语言从数据库中检索用户/密码,然后继续登录。

What if you send them a unique ID (linked to a specific user) instead of a username and password that they use to log in? That way it's "safe" for the outside word if you don't know a key, and those users don't have any knowledge about their actual username/password.

Something like: http://yourdomain.com/login.php?key=12345ABCD678.
Or nicer, with a mod_rewrite: http://yourdomain.com/login/12345ABCD678.

In your login script, $_GET that ID, retrieve the user/pass from the database with your language of choice, and proceed with the login.

江湖彼岸 2024-09-09 17:15:43

我认为您需要使用某种服务器端语言来完成此操作,例如 cURL

我认为几乎每种语言都有 cURL 的实现,其中最流行的是 PHP 的实现

我认为这可能是您拼图中缺失的一块。

I think you'll want to do this using some sort of server side language using cURL.

There is an implementation of cURL in just about every language I think, one of the most popular is however PHP's implementation.

I think this might be the missing piece to your puzzle.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文