简体   繁体   English

Codeigniter和Opauth Twitter策略用户拒绝访问

[英]Codeigniter and Opauth twitter strategy User denied access

I'm trying to implement login through twitter using Opauth on Codeigniter, it work fine in localhost but when i website goes live, i get this error: 我正在尝试使用Codeigniter上的Opauth通过Twitter实现登录,它在localhost中工作正常,但是当我的网站上线时,出现此错误:

Array (
    [error] => Array
        (
            [code] => access_denied
            [message] => User denied access.
            [raw] => Array
                (
                    [oauth_token] => XXXXXXXXX
                    [oauth_verifier] => XXXXXXXXXXXX
                )
            [provider] => Twitter
        )
    [timestamp] => 2015-10-09T14:18:58+00:00 )

I accept the connection, i didn't deny it. 我接受连接,但我没有否认。 i change the website and callback api to be my domain. 我将网站和回调API更改为我的域。 but i get the above error . 但是我得到了上面的错误。 when i test it on localhost (website: localhost + callback: localhost) it work fine i dont get any error . 当我在localhost(网站:localhost +回调:localhost)上对其进行测试时,它工作正常,我没有收到任何错误。 i dont know why it work on local host and it doesn't wok on live 我不知道为什么它可以在本地主机上运行,​​而且不能实时启动

I figure out that the problem was htacces. 我发现问题出在htacces。 so i use this code and it works now 所以我使用此代码,它现在可以工作

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM