在本地主机上运行的webapp中的openid和facebook身份验证 [英] openid and facebook authentication in webapp running on localhost

查看:98
本文介绍了在本地主机上运行的webapp中的openid和facebook身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的java/javascript Web应用程序正在开发中,并且我有一个javascript应用程序,该应用程序使用ajax POST命令与vmware计算机中本地主机上运行的servlet容器与数据库通信(我在其中维护自己的用户ID).我希望能够在此开发设置上使用Google,Yahoo和Facebook身份验证进行登录,但是在研究Facebook的OAuth 2.0方法时,您的Web应用程序似乎必须具有指向Facebook网站的链接,并提供重定向链接身份验证完成后,返回您自己的站点.此方法行不通,因为Facebook无法重定向到本地主机地址并访问没有网络的我的机器.

My java/javascript web application is in development, and I hava a javascript application that communicates with my database (where I maintain my own userids) using ajax POST commands to a servlet container running on localhost, within a vmware machine. I want to be able to login using Google, Yahoo, and Facebook authentication, on this development setup, but in studying Facebook's OAuth 2.0 method, it looks like your web application has to hava a link to the facebook site, and provide a redirect link back to your own site when authentication is finished. This method won't work because facebook can't redirect to a localhost address and reach my machine, which doesn't have a web presence.

我在使用OpenID和Google/Yahoo身份验证时是否遇到相同的问题?

Do I have the same issues with OpenID and Google/Yahoo authentication?

安迪

推荐答案

Facebook OAuth可与localhost应用程序配合使用.这是因为Facebook将浏览器重定向到您在oauth中提供的redirect_uri,您的浏览器知道http://localhost的位置(我实际上在apache& Windows vhosts中使用了虚拟主机,不知道(如果您可以在应用设置中输入localhost作为网站网址).完美运行

Facebook OAuth works with localhost apps. This is because Facebook redirects the browser to the redirect_uri you supply in oauth, your browser knows where http://localhost is (I actually used a virtual host in apache & windows vhosts, don't know if you can enter localhost as website url in your app settings). Works perfectly

但是,以我的经验,Google Oauth在本地版本上不起作用.要以某种方式需要从Google本身(不仅是浏览器)访问该网站,该网站就不能正常运行,因此无法正常运行(抱歉,我不记得确切的详细信息)

Google Oauth however, in my experience, doesn't work on local version. Somehow the site needed to be accessible from Google itself (not just the browser) for this to work, and it didn't, so it doesn't (I don't remember the exact details, sorry)

对其他人一无所知

这篇关于在本地主机上运行的webapp中的openid和facebook身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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