0

我在 codeigniter 中构建了一个简单的 url 缩短应用程序,它还允许用户通过 facebook 登录。

首次授权时,它在允许 facebook 权限后返回服务器错误。

我已将问题缩小到我的路由文件或我的 htaccess。但无论我尝试什么,我都无法让它工作。

由于该应用程序是一个 url 缩短器,因此任何未指定的路由都使用默认路由。像这样...

$route['login'] = "auth/login";
$route['about'] = "pages/about";
$route['(:any)'] = "redirect/index/$1"; 

我认为这就是它无法验证的原因。我试着做:

$route['auth_social/(:any)'] = "auth_social/$1";

这也不起作用。我唯一可以让它工作的时间是如果我将我的 .htaccess 更改为

RewriteEngine on
RewriteCond $1 !^(index\.php|images|table-images|js|robots\.txt|css|captcha)
RewriteRule ^(.*)$ /index.php/$1 [L]

但后来我的网址缩短中断并且不起作用。这让我疯狂。

任何人都可以在这里看到我哪里出错了吗?

这是我的完整 .htaccess 文件

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

编辑:

这是来自服务器日志的错误:

 [10-Jan-2013 11:02:25 UTC] PHP Fatal error:  Uncaught OAuthException: An active access token must be used to query information about the current user.
  thrown in /Users/mycomputer/Documents/grpe/app/application/libraries/facebook/base_facebook.php on line 1058
4

1 回答 1

0

您使用的是什么 oAuth 库?

我强烈建议使用这个 oAuth2 sparks 库:
http ://getsparks.org/packages/oauth2/versions/HEAD/show

我已经使用它一段时间了,登录/注册完全没有任何问题。

高温高压

于 2013-01-10T13:55:04.953 回答