集成Facebook登录名和Facebook C#SDK-不是Facebook应用 [英] Integrating facebook login and facebook c# SDK - NOT a facebook app

查看:93
本文介绍了集成Facebook登录名和Facebook C#SDK-不是Facebook应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了SDK的示例和5.0.3 beta版,并很快就在Facebook上启动并运行了一个Facebook应用程序-既简单又方便.

I downloaded the samples and the 5.0.3 beta of the SDK, and pretty quickly got a facebook app up and running inside facebook - great and super easy.

但是,我只想将facebook用作一种授权机制,并且我无法从示例和文档中弄清楚如何做到这一点(实际上,除了这里和那里的一些示例之外,我无法找到任何文档).

However, I want to use facebook only as an authorization-mechanism, and I cannot figure out how to do that from the examples and documentation (actually I was unable to find any documentation apart from a few examples here and there).

我在这里没有上下文的情况下找到了这段代码:链接

I found this piece of code without context here: Link

protected void Page_Load(object sender, EventArgs e)
{
    if (!authorizer.IsAuthorized())
    {
        var authurl = authorizer.GetLoginUrl(new HttpRequestWrapper(Request));
        CanvasRedirect(authurl.ToString());
    }
    else
    {
        LoggedIn(); // function to call when the user is logged in to init the page
    }
}

这看起来确实很有趣,但是我无法弄清楚授权者的设置和使用方式.

This looks really interesting, but I cannot figure out what the authorizer is set up and used.

我正在使用MVC 3,但这并不重要.

I am using MVC 3, but that should not really matter.

是否可以为此使用facebook c#sdk-以及如何?

Is it possible to use the facebook c# sdk for this - and how?

推荐答案

DotNetOpenAuth CTP-Facebook错误请求

第一个答案很好,结构合理的代码带有解释,我花了几分钟的时间就完成了工作.

The first answer there is good, with well-structured code with explanation, that I made work in a matter of minutes.

这篇关于集成Facebook登录名和Facebook C#SDK-不是Facebook应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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