codenitive / laravel-oneauth

OAuth and OAuth2 Auth bundle for Laravel

Home Page:http://bundles.laravel.com/bundle/oneauth

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Works local, but not on production

javdl opened this issue · comments

I'm having a problem with Oneauth. It works great on local dev but not on production. The error I get with facebook is string(83) "{"error":{"message":"Missing authorization code","type":"OAuthException","code":1}}" and with twitter I get: string(39) "invalid token after coming back to site" The solution provided in this StackOverflow answer didn't help for me... (also I don't have a blank page like the guy in the SO question. http://stackoverflow.com/questions/11909253/oneauth-blank-callback

Will look into this.

Thanks. By the way, we just found out the body of the response we're getting is emtpy. The header isn't. On our local machine the key is also in the body of the response.

Do you by any chance using a different timezone setting (other than UTC) in production environment. I would need as much information as possible to re-produce this issue, since it's working locally.

Mon Jan 28 16:18:02 CET 2013
So it's CET on production CentoOS NGINX server. On our local server the timezone is Europe/Berlin which is a Windows + Apache server (XAMPP).

Excuse me, the server time in PHP on the production server is UTC. The CET timezone is what I got from running the date command in Linux.

Just letting you know that I ran into this as well. It works fine on local, but on the production server, nothing. I'm getting a blank page on the callback. I used Google's API console to try and log in. And I'm not sure how to activate errors to show you what error I am getting.

It was a .htaccess problem for me. I put this in the public .htaccess file:

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php [L]

Thanks, your comment got me on the right track. The problem is solved now by changing my NGINX settings from: try_files $uri $uri/ /index.php; (got it from the laravel forum) to: try_files $uri $uri/ /index.php?q=$uri&$args; (from nginx wiki). Problem solved! I will comment this config on the Laravel forums as well.

@Cautwell @Joostvanderiaan Would be useful if these information can be documented.