服务器端只有手动登录流向与asp.net身份网页API外部登录画布Facebook的应用程序 [英] Server side only manual login flow to facebook in a canvas app with asp.net identity web api external logins
问题描述
我下面这个教程<一个href=\"http://bitoftech.net/2014/08/11/asp-net-web-api-2-external-logins-social-logins-facebook-google-angularjs-app/\" rel=\"nofollow\">http://bitoftech.net/2014/08/11/asp-net-web-api-2-external-logins-social-logins-facebook-google-angularjs-app/.
第一步Facebook登录流量点击一个Facebook登录按钮,链接到这个网址:
The first step to facebook login flow is to click a facebook login button which links to this url:
<$c$c>http://ngauthenticationapi.azurewebsites.net/api/Account/ExternalLogin?provider=Facebook&response_type=token&client_id=ngAuthApp& REDIRECT_URI = HTTP:/ \\
/ngauthenticationweb.azurewebsites.net/authcomplete.html
在我的情况下,我使用的是Facebook的帆布的应用程序,嵌入里面Facebook。所以,我没有登录按钮。相反,我应该怎么显示/做
在我的index.html发起的Facebook应用程序中的登录流程。
In my case I am using a facebook canvas app, that is embedded inside facebook. So I don't have a login button. Instead what should I display/do in my index.html that initiates login flow within facebook application.
我不使用Facebook的SDK。我只会做这个服务器端,我设置的一切教程以下,但我不知道这是否是可用的withi \\
N A画布应用程序。
I am not using Facebook SDK. I will do this server side only, I've setup everything following the tutorial, but I don't know if that is usable withi\ n a canvas app.
Facebook的文档说,在的https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/v2.4:
Facebook docs says in https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/v2.4:
您的应用程序必须发起一个重定向到一个端点,将显示登录对话框
Your app must initiate a redirect to an endpoint which will display the login dialog
<$c$c>https://www.facebook.com/dialog/oauth?client_id={app-id}&redirect_uri={redirect-uri}$c$c>
所以在我的情况下,我应该将用户重定向到上面一个由Facebook登录按钮链接该URL,会是这样行吗?
So in my case should I redirect users to that url above that is linked by a facebook login button, would that be ok?
推荐答案
有一个详细的登录Facebook上的文档。在这里引用它的某些重要的部分:
There is a detailed login on Facebook doc. To quote some important parts of it here:
由于你的游戏是在iframe中加载,返回一个302重定向
用户登录对话框将不会成功。相反,你必须
靶的顶部(或_top)帧重定向,这将导致亲
窗口重定向到登录对话框URL。
Because your game is loaded in an iframe, returning a 302 to redirect the user to the Login Dialog will be unsuccessful. Instead you must target the top (or _top) frame for redirect, which causes the parent window to redirect to the Login Dialog URL.
和也:
当使用非JavaScript SDK重定向方法,它们将被发送
回传给登录对话框中REDIRECT_URI。在这种情况下,我们
建议您设置REDIRECT_URI是你游戏的画布URL。
因为signed_request将访问令牌被张贴沿
这个时候,你的应用程序现在可以从签名的请求采集令牌
如上
When using the non-JavaScript SDK redirect method, they will be sent back to the redirect_uri passed to the Login Dialog. In this case, we recommend you set this redirect_uri to be the Canvas URL of your game. Because the signed_request will be POSTed along with an access token this time, your app can now capture the token from the signed request as above.
这篇关于服务器端只有手动登录流向与asp.net身份网页API外部登录画布Facebook的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!