我正在使用这样的FB交换令牌api:
https://graph.facebook.com/oauth/access_token?client_id={client_id}8&client_secret={client_secret}}&grant_type=fb_exchange_token&fb_exchange_token={one_hour_token}&redirect_uri=http%3A%2F%2Fotagz.cloudfoundry.com%2FfacebookCallback
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
"message":"缺少redirect_uri参数.",键入":"OAuthException","code":191
我有我的申请网址:otagz.cloudfoundry.com
我知道有关于这个问题的另一个问题,但没有解决方案,而且是从2010年开始.
有人知道redirect_uri有什么问题吗?
谢谢,克里斯蒂安
隐含流动被认为是不安全的.我知道两个问题:
它看起来并不太糟糕.是否还有其他我不知道的安全漏洞?
尝试发布到用户流时,我从Facebook收到以下错误.
Error validating access token: The session has been invalidated because the user has changed the password or because auth.expireSession was called.
工作流程如下:
授权Facebook请求scope=offline_access,publish_stream权限(如果当前用户尚未授权)
在服务器上做一些工作(需要5-10分钟)
尝试发布到用户的Facebook流
此代码适用于许多用户,但对于某些用户,我收到Error validating access token错误.它开始在几周前经常发生,然后似乎停止了,现在又发生了很多.我当然不是在呼唤auth.expireSession我的目的,而且似乎不太可能多个用户在5-10分钟的窗口中将其密码从授权发布到发布.有谁知道这可能导致什么?
facebook facebook-graph-api facebook-oauth facebook-stream-story facebook-permissions
我正在试图弄清楚如何使用ASP.Net MVC 4的新OAuthWebSecurity功能.点击Facebook或Twitter外部登录按钮是否有可能将表单发布到弹出窗口而不是刷新当前页面?在使用Javascript之前我曾在Twitter和Facebook上使用oauth,并且弹出窗口中会发生外部身份验证.异步返回结果后,弹出窗口将关闭.我可以使用MVC 4的新OAuthWebSecurity功能执行类似的操作吗?谢谢.
oauth-provider oauth-2.0 facebook-oauth asp.net-mvc-3 asp.net-mvc-4
App Domains: localhost
Website with Facebook login: http://localhost/auth
Run Code Online (Sandbox Code Playgroud)
我转到http://localhost/auth/我的Chrome开发者控制台,我看到错误:Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
我做一个view-source看到以下内容:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<div id="fb-root"></div>
<script>
// …Run Code Online (Sandbox Code Playgroud) 我的Web应用程序已部署到生产站点,但我还需要执行本地开发.此外,我有几个测试服务器,我在那里执行不同的测试活动.我想为Facebook OAuth2指定所有这些URI.使用Google OAuth2没有问题:我可以根据需要指定尽可能多的重定向URI.
这可能与Facebook有关吗?怎么样?我使用"Facebook登录网站"选项与Facebook集成.
目前我得到:
{
error: {
message: "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
type: "OAuthException",
code: 191
}
}
Run Code Online (Sandbox Code Playgroud) Facebook提供了一些有关oauth登录参数的文档.
参数是:
是否有关于不同类型的oauth功能及其附带参数的更多信息?
我想了解如何构建URL的信息oauth.我知道几种配置.例如:
https://www.facebook.com/dialog/oauth?
client_id=YourAppID
&redirect_uri=The URL that you designated in your App Settings for your App
&response_type=token //Whether you want a `code` returned, or a `token` returned, or both
&scope=publish_stream // scope prompts the user for the type of permissions being asked for
Run Code Online (Sandbox Code Playgroud)
我看到一个讨论显示:
https://graph.facebook.com/oauth/authorize?
client_id=123456789
&redirect_uri=http://example.com/
&scope=publish_stream,share_item,offline_access,manage_pages
Run Code Online (Sandbox Code Playgroud)
请注意URL的差异:
/dialog/oauth?
Run Code Online (Sandbox Code Playgroud)
要么
/oauth/authorize?
Run Code Online (Sandbox Code Playgroud)
怎么authorize办?是否授予权限而不是为权限请求权限?这方面的文件在哪里?
我知道并非所有提供商都提供用户电子邮件地址,但假设他们使用oauth2并且电子邮件字段不为空,我是否可以说该电子邮件地址必须经过验证?
我们的网络应用程序允许用户通过 Facebook 登录。从技术上讲,我们使用的是 Facebook OAuth2。我们两年前就实现了这个登录流程。在 2015 年 11 月 13 日之前它都运行良好,但从那天起就不再运行了。
当我们的服务器发送带有适当参数(、、、 )的请求
https://graph.facebook.com/oauth/access_token时,来自 Facebook 的响应的 HTTP 状态为 400。响应正文是一个 HTML 页面,内容为“抱歉,发生了什么事”错误的”。client_idredirect_uriclient_secretcode
11月13日,Facebook可能出现了一些问题。我发现以下消息: http://www.independent.co.uk/life-style/gadgets-and-tech/news/facebook-down-site-breaks-for-many-people-though-not-for -大家-a6732906.html
然而,一周后我们的服务器仍然收到此错误响应。我们在生产环境中部署了一个系统实例,在测试环境中又部署了一个实例(具有不同的 Facebook 帐户,即具有不同的client_id和client_secret)。目前,Facebook登录在测试环境中运行良好。我不确定11月13日是否有效。
您有从此类问题中恢复的经验吗?为什么同一应用程序中 Facebook 登录在测试环境中有效,而在生产环境中不起作用?为什么生产实例在某一天出现故障,一周后仍然出现故障?
谢谢你的帮助。
我试图理解OAuth是如何工作的,但感觉就像是一个巨大的魔术表演,我不喜欢这样.
我创建了一个新的MVC5项目并启用了facebook身份验证.这一切都运行正常,但是,我试图了解这是如何工作的.
这是我迷路的部分.想象一下,用户想要第一次登录.这个方法是执行的:
public async Task<ActionResult> ExternalLoginCallback(string returnUrl)
{
var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
if (loginInfo == null)
{
return RedirectToAction("Login");
}
// Sign in the user with this external login provider if the user already has a login
var result = await SignInManager.ExternalSignInAsync(loginInfo, isPersistent: false);
switch (result)
{
case SignInStatus.Success:
return RedirectToLocal(returnUrl);
case SignInStatus.LockedOut:
return View("Lockout");
case SignInStatus.RequiresVerification:
return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = false });
case SignInStatus.Failure:
default:
// If the user does not have …Run Code Online (Sandbox Code Playgroud) facebook-oauth ×10
facebook ×5
oauth-2.0 ×5
oauth ×4
google-oauth ×2
asp.net-mvc ×1
c# ×1
crash ×1
oauth2 ×1
redirect ×1