Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vkontakte OAuth2 provider #272

Merged
merged 1 commit into from
Apr 21, 2011
Merged

Vkontakte OAuth2 provider #272

merged 1 commit into from
Apr 21, 2011

Conversation

german
Copy link
Contributor

@german german commented Apr 20, 2011

I added an OAuth2 provider for Vkontakte (vkontakte.ru is a major social network in Russia and CIS). They just recently added OAuth2 as an authentication option. I tested it thoroughly on my production site and it works fine.

@mbleigh mbleigh merged commit d214b15 into omniauth:master Apr 21, 2011
@puffy
Copy link

puffy commented May 3, 2011

Vkontakte provider doesn't work for me. I'm testing it on local machine application. I'm registering, configuring app on vk.com and write AppID and AppKey to omniauth.rb. After redirecting from vk.com development.log of my application looks like this:

Started GET "/auth/vkontakte/callback?code=65b06699144b076fff" for 127.0.0.1 at Tue May 03 18:39:32 +0400 2011

NoMethodError (You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]):

@german
Copy link
Contributor Author

german commented May 3, 2011

@Ssherif could you provide error's traceback please?

@puffy
Copy link

puffy commented May 3, 2011

Trace:

oa-oauth (0.2.4) lib/omniauth/strategies/vkontakte.rb:39:in user_data'
oa-oauth (0.2.4) lib/omniauth/strategies/vkontakte.rb:75:in auth_hash' oa-core (0.2.4) lib/omniauth/strategy.rb:107:in callback_phase'
oa-oauth (0.2.4) lib/omniauth/strategies/oauth2.rb:78:in callback_phase' oa-core (0.2.4) lib/omniauth/strategy.rb:54:in call!'
oa-core (0.2.4) lib/omniauth/strategy.rb:26:in call' oa-core (0.2.4) lib/omniauth/strategy.rb:59:in call!'
oa-core (0.2.4) lib/omniauth/strategy.rb:26:in call' oa-core (0.2.4) lib/omniauth/strategy.rb:59:in call!'
oa-core (0.2.4) lib/omniauth/strategy.rb:26:in call' oa-core (0.2.4) lib/omniauth/strategy.rb:59:in call!'
oa-core (0.2.4) lib/omniauth/strategy.rb:26:in call' oa-core (0.2.4) lib/omniauth/builder.rb:30:in call'
haml (3.0.25) lib/sass/plugin/rack.rb:41:in call' actionpack (3.0.7) lib/action_dispatch/middleware/best_standards_support.rb:17:in call'
actionpack (3.0.7) lib/action_dispatch/middleware/head.rb:14:in call' rack (1.2.2) lib/rack/methodoverride.rb:24:in call'
actionpack (3.0.7) lib/action_dispatch/middleware/params_parser.rb:21:in call' actionpack (3.0.7) lib/action_dispatch/middleware/flash.rb:182:in call'
actionpack (3.0.7) lib/action_dispatch/middleware/session/abstract_store.rb:149:in call' actionpack (3.0.7) lib/action_dispatch/middleware/cookies.rb:302:in call'
activerecord (3.0.7) lib/active_record/query_cache.rb:32:in call' activerecord (3.0.7) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in cache'
activerecord (3.0.7) lib/active_record/query_cache.rb:12:in cache' activerecord (3.0.7) lib/active_record/query_cache.rb:31:in call'
activerecord (3.0.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in call' actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:46:in call'
activesupport (3.0.7) lib/active_support/callbacks.rb:416:in _run_call_callbacks' actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:44:in call'
rack (1.2.2) lib/rack/sendfile.rb:107:in call' actionpack (3.0.7) lib/action_dispatch/middleware/remote_ip.rb:48:in call'
actionpack (3.0.7) lib/action_dispatch/middleware/show_exceptions.rb:47:in call' railties (3.0.7) lib/rails/rack/logger.rb:13:in call'
rack (1.2.2) lib/rack/runtime.rb:17:in call' activesupport (3.0.7) lib/active_support/cache/strategy/local_cache.rb:72:in call'
rack (1.2.2) lib/rack/lock.rb:11:in call' rack (1.2.2) lib/rack/lock.rb:11:in synchronize'
rack (1.2.2) lib/rack/lock.rb:11:in call' actionpack (3.0.7) lib/action_dispatch/middleware/static.rb:30:in call'
railties (3.0.7) lib/rails/application.rb:168:in call' railties (3.0.7) lib/rails/application.rb:77:in send'
railties (3.0.7) lib/rails/application.rb:77:in method_missing' /Users/puffy/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/lib/nack/server.rb:146:in handle'
/Users/puffy/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/lib/nack/server.rb:99:in start' /Users/puffy/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/lib/nack/server.rb:86:in each'
/Users/puffy/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/lib/nack/server.rb:86:in start' /Users/puffy/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/lib/nack/server.rb:66:in loop'
/Users/puffy/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/lib/nack/server.rb:66:in start' /Users/puffy/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/lib/nack/server.rb:13:in run'
/Users/puffy/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/bin/nack_worker:4`

@german
Copy link
Contributor Author

german commented May 3, 2011

yes, I overlooked this scenario, but it seems that user heydiplo already fixed it in his pull request #302

@puffy
Copy link

puffy commented May 3, 2011

I tried to use latest github version of omniauth, but have the same prtoblem

@german
Copy link
Contributor Author

german commented May 3, 2011

yes, it happened because it's not merged into master yet) you could use https://github.com/heydiplo/omniauth for now

@german
Copy link
Contributor Author

german commented May 3, 2011

@Ssherif ok, you could use master now: 99a316f

@puffy
Copy link

puffy commented May 4, 2011

great, it's work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants