如何从oauth认证返回注册页面? 我输入了应用程序的 url(如 &redirect_uri=),但是当用户接受身份验证时,脚本失败:
Error: Access to 'app://6cb90889-d3dd-4ca7-8bab-ea11831b922d/reg.html#access_token=xxxxxxxxxxx' from script denied
它应该关闭浏览器并返回到应用程序!有什么想法吗?
最佳答案
URL 的重定向由服务器负责。服务器必须理解redirect_uri=属性并需要重定向它。
对于 J2EE。 它将被完成为
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException {
String contextPath= "http://www.java2s.com";
response.sendRedirect(response.encodeRedirectURL(contextPath + "/maps"));
}
如果您尝试不同的方法,请告诉我。
问候, 钱德拉。
关于javascript - [JS]返回索引页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29174399/