Use jQuery to get session from Minecraft.net [duplicate]

折月煮酒 提交于 2019-12-13 10:13:22

问题


Possible Duplicate:
XmlHttpRequest error: Origin null is not allowed by Access-Control-Allow-Origin

I'm trying to use jQuery to get session id's and stuff from Minecraft.net using

https://login.minecraft.net?user=<username>&password=<password>&version=99999

But I can't get it because there is the "Access-Control-Allow-Origin". The data I receive from the server isn't even json which is even harder for me to figure out how to get data with javascript. I'm doing this so users won't go crazy with suspicions that I'm trying to steal their account.

This is something like what I'd receive

1343825972000:deprecated:SirCmpwn:7ae9007b9909de05ea58e94199a33b30c310c69c:dba0c48e1c584963b9e93a038a66bb98

Read more here. http://www.wiki.vg/Authentication#Login


回答1:


You can't do this in the browser, outside of a plugin installed by that user.

If you want to go to that url and get those values, you would need to use a server-side browser. Something like mechanize or phantomjs would be well suited for this sort of thing.



来源:https://stackoverflow.com/questions/13576465/use-jquery-to-get-session-from-minecraft-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!