koskad Posted January 22, 2019 Share Posted January 22, 2019 Всех приветствую! Не могу настроить регистрацию и вход на сайт через аккаунт google. Делал всё по инструкции. Создал идентификатора клиента OAuth в google. В разрешенных URI перенаправлениях указал https:// мойсайт .ru/oauth/callback/. На сайте ввёл полученный id и ключ. Но при попытке войти через google пишет следующее "Something went wrong. Please try again." Свежеустановленная версия 4.3.6. Плагинов нет. В настройках включен Rewrite URLs. Установлен сертификат SSL. В REST & OAuth ничего не настраивал. Подскажите пожалуйста, что я сделал не так? Link to comment Share on other sites More sharing options...
newbie Posted January 22, 2019 Share Posted January 22, 2019 В системных журналах (System Logs) есть записи, относящиеся к google? Link to comment Share on other sites More sharing options...
siv1987 Posted January 22, 2019 Share Posted January 22, 2019 Вы точно правильно настроили Project и включили Google+ Api? Project %project name% is not found and cannot be used for API calls. If it is recently created, enable Google+ API by visiting https://console.developers.google.com/apis/api/plus.googleapis.com/overview?project= then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.https://console.developers.google.com/apis/api/plus.googleapis.com/overview Link to comment Share on other sites More sharing options...
koskad Posted January 22, 2019 Author Share Posted January 22, 2019 Да, все необходимые google API включены. Сайт работает на связке FastCGI (Nginx + PHP-FPM). Возможно проблема с конфигом nginx?Вот так настроен nginx для REST API и mod_rewrite: location / { location /api/ { if (!-e $request_filename){ rewrite ^/api/(.*)$ /api/index.php; } } try_files $uri $uri/ /index.php; location ~ [^/]\.ph(p\d*|tml)$ { try_files /does_not_exists @php; } location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ { expires 7d; } } В логах: Array( [error] => invalid_grant [error_description] => Bad Request) #0 /system/Login/Handler/OAuth2/OAuth2.php(525): IPS\_Log::log('Array\n(\n [er...', 'oauth') #1 /system/Login/Handler/OAuth2/OAuth2.php(339): IPS\Login\Handler\_OAuth2->_exchangeAuthorizationCodeForAccessToken('4/2gBkIUHLlvgyE...') #2 /system/Login/Handler/OAuth2/OAuth2.php(150): IPS\Login\Handler\_OAuth2->_handleAuthorizationResponse(Object(IPS\Login)) #3 /system/Login/Login.php(274): IPS\Login\Handler\_OAuth2->authenticateButton(Object(IPS\Login)) #4 /applications/core/modules/front/system/login.php(48): IPS\_Login->authenticate() #5 /system/Dispatcher/Controller.php(96): IPS\core\modules\front\system\_login->manage() #6 /system/Dispatcher/Dispatcher.php(146): IPS\Dispatcher\_Controller->execute() #7 /index.php(13): IPS\_Dispatcher->run() #8 {main} Link to comment Share on other sites More sharing options...
siv1987 Posted January 22, 2019 Share Posted January 22, 2019 api и настройки сервера тут никакого отношения не имеют потому что используется авторизация oauth. Для нее не требуется Rewrite. Покажите скриншот в гугле с включенным Google+ Api и настройками проекта.В логах кстати написано что не хватает гранта (прав) Link to comment Share on other sites More sharing options...
koskad Posted January 22, 2019 Author Share Posted January 22, 2019 Вот скрины Link to comment Share on other sites More sharing options...
siv1987 Posted January 22, 2019 Share Posted January 22, 2019 Включить нужно только один - Google+, остальные не обязательно.Урл для перенаправления указали правильно? И укажите правильный Board Url в профиле. Link to comment Share on other sites More sharing options...
koskad Posted January 23, 2019 Author Share Posted January 23, 2019 Пробовал подключать другие методы входа (facebook, microsoft) и не с одним не входит. Link to comment Share on other sites More sharing options...
siv1987 Posted January 23, 2019 Share Posted January 23, 2019 Лишние редиректы на сервере ничего не ломают? Все нужные расширения на сервере установлены, в частности curl?Колбэк адрес указали с https? Link to comment Share on other sites More sharing options...
koskad Posted January 23, 2019 Author Share Posted January 23, 2019 curl обновлён до версии 7.63. Колбэк адрес указан с https. Это всё что я добавил в конфиг:location /api/ { if (!-e $request_filename){ rewrite ^/api/(.*)$ /api/index.php; } } try_files $uri $uri/ /index.php; Редиректы на сервере ничего не ломают. При попытке залогиниться через steam получаю это: Link to comment Share on other sites More sharing options...
newbie Posted January 23, 2019 Share Posted January 23, 2019 При попытке залогиниться через steam получаю это: Система определила Вас как спамера. 1 Link to comment Share on other sites More sharing options...
koskad Posted January 23, 2019 Author Share Posted January 23, 2019 @newbie, точно! Я не подумал об этом. Отключил защиту от спама и всё заработало. Спасибо большое :D Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now