1
1

I would like to add a link to Facebook authentication to the header links (to the left of the "login" link, and only visible when the user is not authenticated).

The behavior of the link should be the same as the Facebook button with is currently included in the signin page (together with the Google, Yahoo, etc. buttons).

How can I do that ? Thanks!

asked 20 Sep '10, 05:33

Oscar's gravatar image

Oscar ♦
2.1k305666
accept rate: 27%

edited 20 Sep '10, 05:45

I see you solved it, can you explain how?

(08 Nov '10, 11:46) blindOSX

You can add the Facebook login button just going to the account login page (for example: http://meta.osqa.net/account/signin/) and copying the javascript code that starts with:

<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"></script>

And ends with:

<fb:login-button v="2" size="medium" onlogin="FB_ConnectPostAuthorization()">Facebook</fb:login-button>

Then paste it into header.html below this code:

<div id="top">

And surrounded by:

{% if not request.user.is_authenticated %}

and:

{% endif %}
link

answered 09 Nov '10, 07:12

Oscar's gravatar image

Oscar ♦
2.1k305666
accept rate: 27%

Hi,

thanks for the reply, the problem is that I would like to use my custom buttons. You can see here. And with the facebook label fb:login-button I can not use them.

Right now, I have in header.html:

<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"></script>
<script type="text/javascript">
function Login() {
    var FB_API_KEY = "399ed18491cfdcd6b4cc3a1ec700f200";
    var FB_CHANNEL_PATH = "/xd_receiver.htm";

FB.init(FB_API_KEY, FB_CHANNEL_PATH, {permsToRequestOnConnect : "email"});
    window.location = "/cuenta/facebook/hecho/";
};
</script>

<a id="fb-login" class="fbloginbutton button facebook" title="Entrar con Facebook" onClick="Login();"><strong>Entrar</strong></a>

But It does not work, I get this error in /count/login:

The authentication with Facebook connect failed, cannot find authentication tokens

link

answered 09 Nov '10, 08:17

blindOSX's gravatar image

blindOSX
1612614
accept rate: 20%

edited 09 Nov '10, 08:18

I've tried the code above and I get a working button.. but the button mirrors itself and I've tried everything to remedy. Any ideas? Here's my site.

(24 Jan, 21:18) andi
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×73
×38
×31
×4

Asked: 20 Sep '10, 05:33

Seen: 1,267 times

Last updated: 25 Jan, 00:58

powered by OSQA