mamantoha / omniauth-vkontakte Goto Github PK
View Code? Open in Web Editor NEWVkontakte OAuth2 Strategy for OmniAuth
License: MIT License
Vkontakte OAuth2 Strategy for OmniAuth
License: MIT License
В приложении используется авторизация twitter, facebook, odnoklassniki, все они работают нормально, проблема именно с vkontakte
после нажатия на кнопку подтвердить в логах сервера появляется следующее
Started GET "/user/auth/vkontakte/callback?code=be613f43c1a4879166&state=5d078f6c6737f048775ffc710270c0aed41c66468ffa175d" for 127.0.0.1 at 2012-12-11 04:33:12 +0400
и на этом все, дальше ни чего не происходит
может в курсе из-за чего такое может быть?
App raise "invalid credensials" when login secons time. Debugin' issue I found it depends on gem versions.
This fails:
bundle show |grep omni
* omniauth (1.1.0)
* omniauth-oauth (1.0.1)
* omniauth-oauth2 (1.1.0)
* omniauth-vkontakte (1.0.6)
This works perfect:
bundle show |grep omni
* omniauth (1.0.3)
* omniauth-oauth (1.0.1)
* omniauth-oauth2 (1.0.0)
* omniauth-vkontakte (1.0.6)
Maybe its devise issue - I can't found it.
Hi,
In my application I want to post image on friend wall.
(https://api.vk.com/method/photos.saveWallPhoto?owner_id
https://api.vk.com/method/wall.post)
With the above two API calls with other information accessToken,etc. I always see the Captcha image again and again (in the Captcha I always put the right character).In ownerid I put my friend ID.
Could you look into it that.
Thanks
After authorizing i get
credentials: !ruby/hash:Hashie::Mash
token: blah
expires_at: 1368545534
expires: true
expires_at is coming back with basically Time.now of the request
irb(main):009:0> Time.at 1368545534
=> 2013-05-14 15:32:14 +0000
Доброго времени суток.
Использую rails 5.1.4 без devise. Режим config.api_only не включен.
В конфиге:
provider :vkontakte, ENV['OAUTH_APP_ID'], ENV['OAUTH_VK_SECRET'],
scope: 'email, photos',
image_size: 'original',
redirect_url: 'http://localhost:3000/api/v1/oauth/callback',
display: 'page',
lang: 'ru',
https: 1
Дергаю get /auth/vkontakte - происходит корректный запрос к vk - корректный редирект на redirect_url, но в экшене коллбека request.env['omniauth.auth'] == nil.
Через https://github.com/mkdynamic/omniauth-facebook все работает корректно.
Не подскажете, в чем может быть проблема?
UPD расставил брекпоинты дебаггера здесь: https://github.com/omniauth/omniauth/blob/master/lib/omniauth/strategy.rb, ни в одну не попало. То есть вообще не отрабатывает
Лог ошибки:
(vkontakte) Callback phase initiated.
(vkontakte) Authentication failure! invalid_credentials: OAuth2::Error, invalid_grant: Code is invalid or expired.
{"error":"invalid_grant","error_description":"Code is invalid or expired."}
Точно такая же ошибка была с omniauth-facebook 1.4.1, но если откатить до 1.4.0 все работает отлично:
(facebook) Callback phase initiated.
Started GET "/users/auth/facebook/callback" for 127.0.0.1 at 2013-04-18 18:33:56 +0400
Processing by Users::OmniauthCallbacksController#facebook as /
User Load (142.3ms) SELECT "users".* FROM "users" WHERE "users"."url" = 'http://www.facebook.com/...' LIMIT 1
Я пока сам не нашел в чем решающая разница между 1.4.1 и 1.4.0
I think today Vkontakte send another info data and it do error:
undefined method first' for nil:NilClass vendor/bundle/ruby/1.9.1/gems/omniauth-vkontakte-1.1.0/lib/omniauth/strategies/vkontakte.rb:83:in
get_country'
Метод API users.get() возвращает фамилию и имя транслитом, если физически сервер расположен например в штатах.
Вроде это решается указанием нужного заголовка 'Accept-Language'.
Как его можно указать? или эта проблема решается подругому?
Hello, I tried to use this gem but recieve error:
ArgumentError
Received wrong number of arguments. ["eRCcsdw9I5xfZLqe8V", {:authorize_url=>"http://api.vkontakte.ru/oauth/authorize", :token_url=>"https://api.vkontakte.ru/oauth/token"}]
Others strategies: facebook and twitter works fine.
How to fix it?
С каждым днем все интереснее, пользователей правда пугает регистрация без вконтакте.
Выскакивает после нажатия на "разрешить" и редирект на приложение.
…h-vkontakte-1.1.2/lib/omniauth/strategies/vkontakte.rb: 37:in block in <class:Vkontakte>' …uby/1.9.1/gems/omniauth-1.1.1/lib/omniauth/strategy.rb: 102:in
instance_eval'
…uby/1.9.1/gems/omniauth-1.1.1/lib/omniauth/strategy.rb: 102:in block in compile_stack' …uby/1.9.1/gems/omniauth-1.1.1/lib/omniauth/strategy.rb: 101:in
each'
…uby/1.9.1/gems/omniauth-1.1.1/lib/omniauth/strategy.rb: 101:in inject' …uby/1.9.1/gems/omniauth-1.1.1/lib/omniauth/strategy.rb: 101:in
compile_stack'
…uby/1.9.1/gems/omniauth-1.1.1/lib/omniauth/strategy.rb: 315:in info' …uby/1.9.1/gems/omniauth-1.1.1/lib/omniauth/strategy.rb: 328:in
auth_hash'
…uby/1.9.1/gems/omniauth-1.1.1/lib/omniauth/strategy.rb: 355:in callback_phase' …mniauth-oauth2-1.1.1/lib/omniauth/strategies/oauth2.rb: 77:in
callback_phase'
…uby/1.9.1/gems/omniauth-1.1.1/lib/omniauth/strategy.rb: 219:in callback_call' …uby/1.9.1/gems/omniauth-1.1.1/lib/omniauth/strategy.rb: 175:in
call!'
…uby/1.9.1/gems/omniauth-1.1.1/lib/omniauth/strategy.rb: 157:in call' …ations-3.1.4/lib/client_side_validations/middleware.rb: 18:in
call'
…ems/ruby/1.9.1/gems/warden-1.2.1/lib/warden/manager.rb: 35:in block in call' …ems/ruby/1.9.1/gems/warden-1.2.1/lib/warden/manager.rb: 34:in
catch'
…ems/ruby/1.9.1/gems/warden-1.2.1/lib/warden/manager.rb: 34:in call' …hared/gems/ruby/1.9.1/gems/rack-1.4.1/lib/rack/etag.rb: 23:in
call'
…/ruby/1.9.1/gems/rack-1.4.1/lib/rack/conditionalget.rb: 25:in call' …/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb: 205:in
context'
…/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb: 200:in call' …/ruby/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb: 21:in
call'
…ed/gems/ruby/1.9.1/gems/rack-1.4.1/lib/rack/runtime.rb: 17:in call' …hared/gems/ruby/1.9.1/gems/rack-1.4.1/lib/rack/lock.rb: 15:in
call'
…by/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb: 136:in forward' …by/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb: 245:in
fetch'
…by/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb: 185:in lookup' …by/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb: 66:in
call!'
…by/1.9.1/gems/rack-cache-1.2/lib/rack/cache/context.rb: 51:in call' …by/1.9.1/gems/unicorn-4.4.0/lib/unicorn/http_server.rb: 535:in
process_client'
…by/1.9.1/gems/unicorn-4.4.0/lib/unicorn/http_server.rb: 610:in worker_loop' …by/1.9.1/gems/unicorn-4.4.0/lib/unicorn/http_server.rb: 491:in
spawn_missing_workers'
…by/1.9.1/gems/unicorn-4.4.0/lib/unicorn/http_server.rb: 502:in maintain_worker_count' …by/1.9.1/gems/unicorn-4.4.0/lib/unicorn/http_server.rb: 276:in
join'
Привет!
Настройки такие:
config.omniauth :vkontakte, Settings['vkontakte']['app_id'], Settings['vkontakte']['app_secret'], :scope => 'friends,messages'
Что можно с этим сделать? Можно ли указать определенный redirect_uri в настройках при аутоинтификации?
Guys!
I am trying to get user signed in with vkontakte using openapi as written here https://vk.com/dev/Javascript_SDK with omnioauthcallbackcontroller what gives me error ERROR -- omniauth: (vkontakte) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected on callback.
Can you shed some light on what am I doing wrong? Same approach with FB and others work..
I can't make login via Devise
config.omniauth :vkontakte, 'APP_ID', 'APP_SECRET', scope: 'friends,audio,email,offline,video'
url: localhost:3000/users/auth/vkontakte
And I get an error
I, [2015-11-04T13:32:16.541188 #13163] INFO -- omniauth: (vkontakte) Callback phase initiated.
E, [2015-11-04T13:32:17.002804 #13163] ERROR -- omniauth: (vkontakte) Authentication failure! invalid_credentials: OAuth2::Error, invalid_grant: redirect_uri is invalid, please pass same redirect_uri, you used in authorize method.
{"error":"invalid_grant","error_description":"redirect_uri is invalid, please pass same redirect_uri, you used in authorize method."}
Processing by OmniauthCallbacksController#failure as HTML
My Env :
oauth2 (0.8.0)
omniauth (1.1.1)
omniauth-facebook (1.4.1)
omniauth-oauth2 (1.1.1)
omniauth-vkontakte (1.1.0)
rails (2.3.8)
Omniauth-vkontakte return empty extra and info hash:
extra=#> info=#> provider="vkontakte" uid=88888888>
Please bump omniauth-oauth2
version from 1.2 to 1.5
Здравствуйте! Спасибо вам за этот гем.
Прошу меня простить за небольшой сумбур в тексте, не могу разобраться.
У меня есть android-приложение, на котором я получаю access_token через Android SDK. Есть ли способы отправить post
запрос с access_token напрямую в omniauth_vk_callback_path
? Так как это Standalone приложение, у меня нет возможности получать токен с сервера (redirect_uri
стоит дефолтный от вк, т.е https://oauth.vk.com/blank.html
), но при этом нужна авторизация на клиенте и на сервере.
Заранее спасибо за ответ! ❤️
P.S Есть еще способ получить Authorization code, отправить его на сервер и уже с сервера сделать post
запрос и получить access_token
. Есть ли такая возможность сделать это используя данный гем?
vendor/bundle/ruby/1.9.1/gems/omniauth-vkontakte-1.1.1/lib/omniauth/strategies/vkontakte.rb:63:in `raw_info'
Проблема теперь другая. Вконтакт с тукеном теперь не отдает инфу на метод getProfiles.
Ничего не смог найти по этому поводу, в коде вроде все ОК (но проверка parsed["response"] на nil не помешала бы).
Может Вконтакт теперь хочет дополнительные параметры для этого метода?
Возвращает такую ошибку:
{"error":"invalid_request","error_description":"application was deleted"}
Приложения создал бувально 10 минут назад. Домен добавил в /etc/hosts
.
Запускаю на 80-ом порту(rvmsudo rails server -p 80
)
Не подскажешь, в чём может быть проблема?
Would you please give an example how to make wall posts using omniauth-vkontakte?
help please ))
Try to add quality code inspection to Travis CI
I faced a problem that VK authentication was too slow on my production server. Started digging. And found, besides that there was configured slow DNS-server (solved with namebench and dnsmasq), that your gem makes 3 extra calls to VK API, querying user's data. However, these data are only necessary for creating user records for the first time. Could you make these data be queryied only by explicit calls of auth hash properties?
Results of rack-mini-profiler gem:
GET http://127.0.0.1:3000/users/auth/vkontakt... 27.9 +0.0
Net::HTTP POST /access_token 60.8 +15.0
Net::HTTP POST /access_token 25.6 +76.0
Net::HTTP GET /method/users.get?access_token=... 57.0 +103.0
Net::HTTP GET /method/users.get?access_token=... 30.5 +160.0
Net::HTTP GET /method/database.getCountriesBy... 65.1 +192.0
Net::HTTP GET /method/database.getCountriesBy... 23.4 +257.0
Net::HTTP GET /method/database.getCitiesById?... 63.9 +282.0
Net::HTTP GET /method/database.getCitiesById?... 33.6 +346.0
использую:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :vkontakte, ENV['API_ID'], ENV['API_SECRET'],
scope: 'friends',
lang: 'ru',
https: 1,
image_size: 'original'
end
Работает безупречно во всех случаев кроме нескольких профайлов. Интересно что другие интеграции с LinkedIn например выдают {}
что бы пользователь продолжил регистрацию.
Могли бы объяснить почему решили остановить пользователя от дальнейшей регистрации с помощью метода fail!
И вообще в каких случаях может Контакт возвращать пустой ответ?
Вчера всё работало, сегодня выдает /auth/failure?message=invalid_credentials
что с этим делать?)
Since few days ago, callback leads to 502, bad gateway. 1 of 10 attempts work ok, others not, Didn't touch anything, as always. Dev page says there are changes to https since november, can this be a source of problem? https://vk.com/dev/https_only
Создал приложение, в Gemfile: gem 'omniauth-vkontakte'.
Настроил omniauth.rb, в настройке приложения на сайте вк указал:
адрес сайта: http://localhost:3000/
базовый домен: localhost
Всё бы ничего, но когда я делаю link_to "регистрируйтесь вк", "/auth/vkontakte", мне вылезает вот это:
{"error":"invalid_request","error_description":"redirect_uri has wrong domain, check application settings"}
А для facebook и twitter всё работает. В чём дело?
delete this issue pls :)
Сейчас появилась возможность получать емейл, но он он не приходит в ответе, хотя юзер дает разрешение на это.
An error occured after redirect on callback controller. Exeption notification says:
A NoMethodError occurred in #:
undefined method `[]' for nil:NilClass
in logs:
NoMethodError (undefined method
[]' for nil:NilClass): omniauth-vkontakte (1.3.1) lib/omniauth/strategies/vkontakte.rb:29:in
block in class:Vkontakte'
omniauth (1.1.4) lib/omniauth/strategy.rb:106:in instance_eval' omniauth (1.1.4) lib/omniauth/strategy.rb:106:in
block in compile_stack'
omniauth (1.1.4) lib/omniauth/strategy.rb:105:in each' omniauth (1.1.4) lib/omniauth/strategy.rb:105:in
inject'
omniauth (1.1.4) lib/omniauth/strategy.rb:105:in compile_stack' (eval):7:in
uid_stack'
omniauth (1.1.4) lib/omniauth/strategy.rb:318:in uid' omniauth (1.1.4) lib/omniauth/strategy.rb:334:in
auth_hash'
omniauth (1.1.4) lib/omniauth/strategy.rb:362:in callback_phase' omniauth-oauth2 (1.1.1) lib/omniauth/strategies/oauth2.rb:77:in
callback_phase'
omniauth (1.1.4) lib/omniauth/strategy.rb:226:in callback_call' omniauth (1.1.4) lib/omniauth/strategy.rb:182:in
call!'
omniauth (1.1.4) lib/omniauth/strategy.rb:164:in call' omniauth (1.1.4) lib/omniauth/strategy.rb:184:in
call!'
omniauth (1.1.4) lib/omniauth/strategy.rb:164:in call' newrelic_rpm (3.7.2.195) lib/new_relic/rack/error_collector.rb:55:in
call'
newrelic_rpm (3.7.2.195) lib/new_relic/rack/agent_hooks.rb:32:in call' newrelic_rpm (3.7.2.195) lib/new_relic/rack/browser_monitoring.rb:27:in
call'
exception_notification (4.0.1) lib/exception_notification/rack.rb:28:in call' /var/www/loveeatwith/shared/bundle/ruby/2.0.0/bundler/gems/client_side_validations-9461cb92e1df/lib/client_side_validations/middleware.rb:21:in
call'
warden (1.2.3) lib/warden/manager.rb:35:in block in call' warden (1.2.3) lib/warden/manager.rb:34:in
catch'
warden (1.2.3) lib/warden/manager.rb:34:in call' rack (1.5.2) lib/rack/etag.rb:23:in
call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in call' rack (1.5.2) lib/rack/head.rb:11:in
call'
remotipart (1.2.1) lib/remotipart/middleware.rb:27:in call' actionpack (4.0.2) lib/action_dispatch/middleware/params_parser.rb:27:in
call'
actionpack (4.0.2) lib/action_dispatch/middleware/flash.rb:241:in call' rack (1.5.2) lib/rack/session/abstract/id.rb:225:in
context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in call' actionpack (4.0.2) lib/action_dispatch/middleware/cookies.rb:486:in
call'
activerecord (4.0.2) lib/active_record/query_cache.rb:36:in call' activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in
call'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:29:in block in call' activesupport (4.0.2) lib/active_support/callbacks.rb:373:in
_run__1289984297035080464__call__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:80:in run_callbacks' actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:27:in
call'
actionpack (4.0.2) lib/action_dispatch/middleware/remote_ip.rb:76:in call' actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in
call'
actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in call' railties (4.0.2) lib/rails/rack/logger.rb:38:in
call_app'
railties (4.0.2) lib/rails/rack/logger.rb:20:in block in call' activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in
block in tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in tagged' activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in
tagged'
railties (4.0.2) lib/rails/rack/logger.rb:20:in call' actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in
call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in call' rack (1.5.2) lib/rack/runtime.rb:17:in
call'
activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in call' rack (1.5.2) lib/rack/sendfile.rb:112:in
call'
railties (4.0.2) lib/rails/engine.rb:511:in call' railties (4.0.2) lib/rails/application.rb:97:in
call'
unicorn (4.7.0) lib/unicorn/http_server.rb:580:in process_client' unicorn (4.7.0) lib/unicorn/http_server.rb:660:in
worker_loop'
newrelic_rpm (3.7.2.195) lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:22:in call' newrelic_rpm (3.7.2.195) lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:22:in
block (4 levels) in <top (required)>'
unicorn (4.7.0) lib/unicorn/http_server.rb:527:in spawn_missing_workers' unicorn (4.7.0) lib/unicorn/http_server.rb:153:in
start'
unicorn (4.7.0) bin/unicorn_rails:209:in <top (required)>' /var/www/loveeatwith/shared/bundle/ruby/2.0.0/bin/unicorn_rails:23:in
load'
/var/www/loveeatwith/shared/bundle/ruby/2.0.0/bin/unicorn_rails:23:in `
'
Hi @mamantoha - at @discourse we use this gem for our https://github.com/discourse/discourse-vk-auth plugin. Thanks for all your work on maintaining it!
Discourse has recently updated to omniauth-oauth2
v1.7.2
, which is listed as incompatible with omniauth-vkontakte
1.7.0
. I see that 45fd03e fixed this problem. Would it be possible to bump the version to 1.7.1
and release it?
@mamantoha push 1.3.3 gem to rubygems please
При авторизации он хочет сделать редирект на URI. В VK у меня создано Standalone приложение, а работать пытаюсь с локально развернутого веб приложения, у которого URI это http://192.168.56.101:3000. Соответственно VK выдает мне
{"error":"invalid_request","error_description":"redirect_uri is incorrect, check application domain in the settings page"}
Могу ли я авторизоваться к локальному веб приложению? И как мне его тогда регистрировать в VK, как Standalone или как веб-сайт?
Привет.
Я новичок и мне достался проект с твоим гемом. Разработчик предыдущий вел разработку прямо с продакшен-сервера и поэтому, видимо, не сталкивался с той проблемой, с которой столкнулся я, и ничем помочь мне не может. А проблема у меня такая же, как и вот в этой ветке, но у меня не получается ее решить тем способом, который там указан.
Т.е. мой продакшен работает по адресу, скажем, xyz.ru
Я иду в /etc/hosts
, комментирую # 127.0.0.1 localhost
и добавляю 127.0.0.1 xyz.ru
Все верно?
После этого перезагружаю систему, делаю rails s и получаю
.rbenv/versions/2.2.2/lib/ruby/2.2.0/socket.rb:232:in 'getaddrinfo': getaddrinfo: Name or service not known (SocketError)
Убиваю процесс и запускаю сервер заново. Он запускается.
=> Booting WEBrick => Rails 4.2.1 application starting in development on http://localhost:3000
Но при этом в ответ на /auth/vkontakte
, мне снова вылезает вот это:
{"error":"invalid_request","error_description":"redirect_uri has wrong domain, check application settings"}
и запрос снова содержит redirect_uri=http%3A%2F%2Flocalhost%3A3000
Там было написано еще запустить сервер на 80-м порту, но я не могу это сделать, тк в ответ на rails s -p 80
получаю Permission denied - bind(2) for 127.0.0.1:80 (Errno::EACCES)
Буду очень благодарен за помощь, самостоятельно разобраться не получается. Готов предоставить любую неоходимую информацию.
Ошибка при запросе /method/getCities
NoMethodError (undefined method first' for nil:NilClass): omniauth-vkontakte (1.1.1) lib/omniauth/strategies/vkontakte.rb:111:in
get_city'
omniauth-vkontakte (1.1.1) lib/omniauth/strategies/vkontakte.rb:118:in location' omniauth-vkontakte (1.1.1) lib/omniauth/strategies/vkontakte.rb:42:in
block in class:Vkontakte'
omniauth (1.1.1) lib/omniauth/strategy.rb:102:in instance_eval' omniauth (1.1.1) lib/omniauth/strategy.rb:102:in
block in compile_stack'
omniauth (1.1.1) lib/omniauth/strategy.rb:101:in each' omniauth (1.1.1) lib/omniauth/strategy.rb:101:in
inject'
omniauth (1.1.1) lib/omniauth/strategy.rb:101:in compile_stack' (eval):7:in
info_stack'
omniauth (1.1.1) lib/omniauth/strategy.rb:315:in info' omniauth (1.1.1) lib/omniauth/strategy.rb:328:in
auth_hash'
omniauth (1.1.1) lib/omniauth/strategy.rb:355:in callback_phase' omniauth-oauth2 (1.1.1) lib/omniauth/strategies/oauth2.rb:77:in
callback_phase'
omniauth (1.1.1) lib/omniauth/strategy.rb:219:in callback_call' omniauth (1.1.1) lib/omniauth/strategy.rb:175:in
call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in call' warden (1.2.1) lib/warden/manager.rb:35:in
block in call'
warden (1.2.1) lib/warden/manager.rb:34:in catch' warden (1.2.1) lib/warden/manager.rb:34:in
call'
Используя vkontakte openapi, делаю ajax запрос, получаю эту ошибку. При этом, когда авторизуюсь через переход по ссылки, все работает.
Мой лог:
Started GET "/users/auth/vkontakte/callback" for 127.0.0.1 at 2017-06-11 02:13:07 +0300
I, [2017-06-11T02:13:07.145807 #2678] INFO -- omniauth: (vkontakte) Callback phase initiated.
E, [2017-06-11T02:13:07.244664 #2678] ERROR -- omniauth: (vkontakte) Authentication failure! invalid_credentials: OAuth2::Error, invalid_grant: Code is invalid or expired.
{"error":"invalid_grant","error_description":"Code is invalid or expired."}
Подскажите, это у меня какие то настройки не верные, или гем не рассчитан на работу с ajax?
Если второй случай, то куда копнуть что бы добавить эту возможность?
В геме oauth2 поменялась auth_scheme по умолчанию с request_body на basic_auth.
Если у вас возникает ошибка client_id is undefined, нужно добавить настройку client_options - auth_scheme
config.omniauth :vkontakte,
ENV['VK_API_ID'], ENV['VK_API_SECRET'],
client_options: {
auth_scheme: 'request_body'
}
Такая же проблема в геме omniauth-apple - nhosoya/omniauth-apple#85
Добрый день.
Установил все что нужно было, прекрасно работает на локалке с доменом localhost:3000, но при деплое на сервер вываливается ошибка.
Почему то
access_token.get('/method/users.get', :params => params).parsed["response"]
возращает nil.
Как понять, какую ошибку возвращает VK и почему?
Спасибо.
Adding { scope: 'offline' }
doesn't seem to work when requesting tokens that don't expire. I still get an expiration time and true for expires.
"credentials"=>{"token"=>"some_token", "expires_at"=>1482941649, "expires"=>true},
And when I do authorize I see that it's asking for offline access but seems to have an expiration still.
Hi, your strategies is:
require 'omniauth/strategies/oauth2'
module OmniAuth
module Strategies
# Authenticate to Vkontakte utilizing OAuth 2.0 and retrieve
# basic user information.
# documentation available here:
# http://vk.com/dev/authentication
#
# @example Basic Usage
# use OmniAuth::Strategies::Vkontakte, 'API Key', 'Secret Key'
#
class Vkontakte < OmniAuth::Strategies::OAuth2
class NoRawData < StandardError; end
API_VERSION = '5.8'
but in app have
error | "invalid_client" error_description | "client_id is incorrect"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.