我正在尝试让 Facebook Feed 对话框在测试站点上工作,但我一直收到相同的错误消息:“[app_name] 发生错误。请稍后再试。”。当我查看文档时,我意识到文档中的示例也不起作用。
尝试了许多不同的解决方案。这是我的测试代码:
<html xmlns:fb="https://www.facebook.com/2008/fbml">
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : '400714233333865', // App ID from the App Dashboard
channelUrl : '//demo.xxxxxxx.se/nptest/channel.html', // Channel File for x-domain communication
status : true, // check the login status upon init?
cookie : true, // set sessions cookies to allow your server to access the session?
xfbml : true // parse XFBML tags on this …Run Code Online (Sandbox Code Playgroud) javascript facebook dialog facebook-javascript-sdk facebook-feed
我正在尝试使用以下代码(取自 javascript FB.Login 示例)来调用 FB iOS 应用程序中的本机弹出窗口,以允许用户登录并验证我们的应用程序。移动 iOS 应用程序是我们 Web 应用程序页面的主要用例。我们使用框架来允许客户在他们的网站上嵌入我们的代码。
下面的示例在直接访问 (fblogin.hml) 时工作正常(并显示正确的 Native Facebook iOS 弹出窗口),但在通过 iframe 访问时不显示任何弹出窗口工作。通过 iframe 调用时,对 FB.ui 的任何调用都可以正常工作。这是 Facebook iOS 应用程序和/或 Javascript SDK 中所需的行为还是问题?我们还有其他方法可以从 iFrame 中调用 FB.Login 吗?
登录页面:
... fblogin.html ..
<html>
<head>
<title>FB.Login example</title>
</head>
<body>
<!-- Load the Facebook JavaScript SDK -->
<script src = "//connect.facebook.net/en_US/all/debug.js"></script>
<div id="fb-root"></div>
<script type="text/javascript">
FB.init({
appId: 'YOUR_FACEBOOK_APP_ID',
xfbml: true,
status: true,
cookie: true,
});
// Check if the current user is logged in and has …Run Code Online (Sandbox Code Playgroud) 我使用 Facebook 作为我的 Web 应用程序 (ASP.NET MVC) 的登录提供程序。
我的登录方式类似于 StackOverflow 的另一篇文章How to secure authorize a user via Facebook's Javascript SDK。我也分享用户的担忧。


var authResponse = response.authResponse;
Run Code Online (Sandbox Code Playgroud)
返回的对象:
{
accessToken: "...",
expiresIn: 1234,
signedRequest: "...",
userID: "123456789"
}
Run Code Online (Sandbox Code Playgroud)
我听说我可以使用signed_request来验证用户的请求,但网上的所有示例都是针对 PHP 的。我如何在 .NET 中执行此操作?
c# asp.net-mvc facebook-javascript-sdk facebook-login asp.net-mvc-5
Facebook的Javascript SDK有一个叫做getLoginStatus停顿的方法(并且永远不会触发传递给它的回调),而页面上的图像请求也会停止(即浏览器很长时间没有收到200或404).
如果你等了很长时间并且浏览器(?)最终关闭了获取图像的尝试,那么SDK继续它的快乐方式.
可能会发生什么,是否有办法防止它?当用户因图像请求无法登录或注册时,这非常不方便.
我正在使用:
- Facebook-JavaScript-SDK(用于登录)
- Angular-JS(前端)
- Spring-Security(服务器安全层)
- Spring MVC(服务器MVC)
用户可以通过(A)使用 Facebook 登录(在 javascript FB SDK 中实现)或
(B)通过普通用户名/密码形式登录我的网络应用程序。
如果是(B),我会使用以下字段进行表单发布:
j_username
j_password
to /j_spring_security_check (Spring Security)
Run Code Online (Sandbox Code Playgroud)
这很好用。
但是在(A)的情况下,用户通过FB(在前端)登录后,
我需要做什么才能让Spring Security为用户创建会话?
此时我所拥有的只是 facebook 用户的电子邮件,而服务器在前端不知道此登录。
spring-mvc spring-security facebook-javascript-sdk angularjs
我尝试在我的网站上使用FB登录,并需要获取用户信息(电子邮件,public_profile,出生日期和地点).但是在登录后我只获得了用户名和facebookId.代码:
<img src="" alt="" onclick="fblogin();"/>
Run Code Online (Sandbox Code Playgroud)
Javascript部分:
function statusChangeCallback(response) {
console.log('statusChangeCallback');
console.log(response);
// The response object is returned with a status field that lets the
// app know the current login status of the person.
// Full docs on the response object can be found in the documentation
// for FB.getLoginStatus().
if (response.status === 'connected') {
// Logged into your app and Facebook.
testAPI();
} else if (response.status === 'not_authorized') {
// The person is logged into Facebook, but not your …Run Code Online (Sandbox Code Playgroud) https://developers.facebook.com/docs/facebook-login/security/
在此页面上,有一个视频讨论与Facebook登录相关的安全问题.大约13分钟,他谈到了oauth代码流.我们的想法是,如果您只是从服务器发出请求,那么您应该生成一个代码,然后您可以在服务器上交换访问令牌.
为此,请将response_type设置为查询参数中的代码.
我的问题是你如何使用SDK做到这一点?该视频表明您需要在设置中将Client Oath Login设置为false:
我这样做了,但我可以在Chrome网络标签中看到SDK仍然将response_type设置为令牌.结果是这个错误:
我错过了什么?
TL; DR我想使用Facebook登录对话框来获取我可以在服务器上交换访问令牌的访问代码.
我需要一个嵌入式 Facebook 页面插件。但是facebook的代码生成器不起作用。当我提供 facebook 页面的 url 时,生成器不会提供此页面的代码。
也不会出现在预览模式中的页面。
脸书页面是:https : //www.facebook.com/Tapas.Enschede/
代码生成器在此页面上。 https://developers.facebook.com/docs/plugins/page-plugin/
对于其他 facebookpages 代码生成器工作完美。我不知道问题是什么。
我真的很感激任何帮助。
我正在尝试使用以下 HTTP 请求创建新的广告创意
response = HTTParty.post(
"https://graph.facebook.com/v2.9/act_#{account_id}/adcreatives",
:query => {
:ad_format => "DESKTOP_FEED_STANDARD",
:access_token => @ads_access_token,
:creative => {
:object_story_spec => {
:object_id => page_id,
:link_data => {
:call_to_action => {
:type => ad_cta,
:value => {
:link => ad_url
}
},
:link => ad_url,
:message => ad_text,
:description => ad_description,
:name => ad_headline,
:picture => ad_image_url
},
:page_id => "233558376717908"
}
}
}
)
Run Code Online (Sandbox Code Playgroud)
但不幸的是,我不断收到以下错误:
{"error"=>
{"message"=>"Invalid parameter",
"type"=>"OAuthException",
"code"=>100,
"error_subcode"=>1487930,
"is_transient"=>false,
"error_user_title"=>"Promoted Object Is Missing",
"error_user_msg"=>
"Your campaign …Run Code Online (Sandbox Code Playgroud) facebook facebook-graph-api facebook-javascript-sdk facebook-marketing-api
这是Vue中一个自包含的Facebook登录组件的来源。我正在尝试将其与AWS Amplify一起使用。我成功显示了Facebook登录屏幕,并且能够在AWS Cognito中获取身份ID。但是,事情还不太顺利。
<template>
<div>
<Button
class="FacebookButton"
v-text="buttonText"
@click="handleClick"
:disabled="isLoading"
/>
</div>
</template>
<script>
import Auth from "@aws-amplify/auth";
import { AmplifyEventBus } from "aws-amplify-vue";
export default {
name: "FacebookButton",
components: {
},
data() {
return {
buttonText: "Login to Facebook",
isLoading: true
};
},
computed: {},
async mounted() {
this.loadFacebookSDK();
await this.waitForInit();
this.isLoading = false;
},
beforeCreate() {},
methods: {
waitForInit() {
return new Promise(res => {
const hasFbLoaded = () => {
if (window.FB) {
res();
} else { …Run Code Online (Sandbox Code Playgroud) facebook ×6
javascript ×2
angularjs ×1
asp.net-mvc ×1
aws-amplify ×1
c# ×1
dialog ×1
iframe ×1
ios ×1
oauth ×1
spring-mvc ×1
vue.js ×1
vuejs2 ×1