FB login works fine if you login through home page; it re-directs the user to user profile after login. But if you login through any other page for e.g. comments on the blog, it gives the error though user has access to submit comments.

Access Denied
You are not authorized to access this page.

Thanks,
=gk

Comments

Nigeria’s picture

I get this error to...initially all will be well the all of a sudden then page will trn to an Access Denied error...turn FBConnect off all is well turn it back on again and it goes haywire.

I also noticed that it seems as if it is looping trying to get some sort of authorisation from Facebook...it looks as if after doingthis a number of times it turns to the Access Denied situation.

gkapoor’s picture

I'm not having that problem. It works like a charm for the most part but in case of login through comment or blog for e.g.

http://www.siteexample.com/user/login?destination=node/152%2523comment-form

It gives "not authorized error".

Thanks,
=gk

greedy43’s picture

I have a constant refreshing page after logging in, this is for any page visited after logging in.

mitchjaz’s picture

I have the same issue. If you log in through Drupal, and then connect, it takes you to http://www.example/user/1/fbconnect and the profile page is displayed.

If you log in through Facebook connect, it redirects you to: http://www.example/user/login after logging in and you receive an access denied error.

gilgabar’s picture

Version: 6.x-1.0-beta6 » 6.x-1.0-beta7
Status: Active » Needs review
StatusFileSize
new290 bytes

It sounds like there might be multiple issues here, but the issue that mitchjaz describes above is the same one that I have encountered and I believe I have fixed.

The issue is that logging in via facebook connect will redirect you to the same page from which you logged in after you are logged in. So if you clicked the login button on the home page that is where you end up after logging in. And when you login via user/login that is where you end up after logging in, but a logged in user gets an access denied message if they try to visit user/login, since it doesn't make sense for a currently logged in user to be there. Ultimately there is probably a more useful message that page could give logged in users than 'access denied', but that's beyond the scope of this fix.

The attached patch just checks if the page is 'user/login', if it is it redirects to 'user', otherwise it behaves normally and redirects to the same page you were on.

gilgabar’s picture

StatusFileSize
new356 bytes

The same issue also occurs with 'user/register' and 'user/password'. The attached patch accounts for those as well.

gkapoor’s picture

Thanks for the patch

I'm not a Drupal developer and not sure how to apply individual module patch. I couldn't find any information on how to, can you please point to instructions?

Thanks again,
=gk

gilgabar’s picture

There are some instructions here: http://drupal.org/patch/apply. They may be more complicated than you need to make things in this case though. First make sure you are using the current version, 6.x-1.0-beta7. The patch is for a single line (line 182) of fbconnect.module. Open that in a text editor and replace the line:

drupal_goto($_GET['q']);

with this line:

drupal_goto(($_GET['q'] == 'user/login' || $_GET['q'] == 'user/register' || $_GET['q'] == 'user/password') ? 'user' : $_GET['q']);

Save, refresh your browser, then log in and see if it fixes the problem for you. Your description sounds like it might be a separate issue, but hopefully this will resolve your problem too.

abraham’s picture

Status: Needs review » Closed (fixed)

Closing this as beta8 uses $form_state['redirect'] to redirect.

Cheek’s picture

Version: 6.x-1.0-beta7 » 6.x-1.0-beta8
Status: Closed (fixed) » Needs review

This was fixed in beta8? I still get access Denied when logging in for the second time.

First time visit > click login > click facebook on login form > create new account facebook connect > homepage (logged in)
Logout
Second time visit > click login > click facebook on login form > access denied (logged in)

PS. is it possible to use template.php to replace the two options when creating a account and remove the list style from the login page?

maxelrod’s picture

This does not seem to be fixed in beta8, However...

I just applied the patch offered up by gilgabar ( in item #8 above ) and it works just fine. The trick is there is a new location for where to place the line of code to fix this:

For Beta8 the drupal_goto function call has moved to line 409. (was 182) So on line 409 I just changed:

drupal_goto($_GET['q']);

to:

drupal_goto(($_GET['q'] == 'user/login' || $_GET['q'] == 'user/register' || $_GET['q'] == 'user/password') ? 'user' : $_GET['q']);

And it now works much better.

Cheers,

Mike

Cheek’s picture

Just want to mention I fixed this by using the '403 2 login' module, which I already had installed. And linking the 'login' button on my site to 'site.com/user'

So, someone clicks the login link 'site.com/user' > '403 2 login' shows login instead of access denied (403) > after logging in it redirects to the user's profile page because it's redirecting to the page you came from.

yrre7’s picture

subscribe

vectoroc’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

chrisphotonic’s picture

I'm having a terrible time with this. I keep getting access denied on one site. Any ideas?

danieljulia’s picture

Same here, still having this problem. Don't close.
The problem appears using Drupal for facebook, and twitter,
so must be in core not in those modules.
Wouldn't it be possible to redirect from user/register automatically if user is already registered/logined?

suudy1’s picture

Version: 6.x-1.0-beta8 » 7.x-2.0-beta4
Assigned: Unassigned » suudy1
Status: Closed (fixed) » Active

I am facing this issue with Drupal 7 version of the module. I am using 7.x beta 4 version of FBConnect module.
Please advice.

jcisio’s picture

Assigned: suudy1 » Unassigned
Status: Active » Closed (fixed)

Revert the status. The last patch was for 6.x-1.x and was more than 3 years ago. If you have problem with 7.x-2.x please file a new issue, with detailed information of course.