T
T
Tr0y2018-03-06 22:05:09
Ruby on Rails
Tr0y, 2018-03-06 22:05:09

Authorization via Vkontakte has failed Ruby on Rails, new Api rules?

Good time of the day
, authorization via Vkontakte on the site has recently flown down (in fact, it has flown through Facebook even earlier),
as I understand the reason for the new requirements of the Vkontakte API, where it is necessary to indicate the version of the script in the request link
, if I’m not mistaken, I found it in the code where the request is generated

# ==> OmniAuth
  # Add a new OmniAuth provider. Check the wiki for more information on setting
  # up on your models and hooks.
  # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'

  # if Rails.env.staging?
  vk_scope = 'email,wall,friends'
  if Rails.env.production?
    if Rails.root.to_s.include?("site.net")
      #site.net
      config.omniauth :facebook, '449881xxxxxx', 'bd4ba0e8500c87dxxxxxx', :scope => 'email,publish_stream,read_friendlists', :display => 'popup', image_size: 'large'
      config.omniauth :vkontakte, 'xxxx859', 'BKPEGnQxxxxxxxxx', :display => 'popup', :scope => vk_scope
    else

  elsif Rails.env.development?
    config.omniauth :facebook, '1205092xxxxx', '621c95d040cxxxxxx', :scope => 'email,publish_stream,read_friendlists', :display => 'popup', image_size: 'large'
    config.omniauth :vkontakte, '4422xxxxx', 'DDGRh9lbZxxxxxx', :display => 'popup', :scope => vk_scope
  else

at the moment on the authorization page the link looks like this
https://oauth.vk.com/authorize?response_type=code&client_id=xxxx859&redirect_uri=https%3A%2F%2Fsite.ru%2Fusers%2Fauth%2Fvkontakte%2Fcallback&state=d88900afc49d321c088978d7e8335337660d3473416f96d0&scope=email%2Cwall%2Cfriends%2Cv&display=popup

As I understand it, at the end there should now be such a &response_type=code&v=5.73
there are examples here https://vk.com/dev/auth_sites
I could not figure it out myself
Help me with editing the code

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alfss, 2018-03-07
@alfss

omniauth should be updated, it will probably solve the problem quickly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question