jamiew / omniauth-youtube

OmniAuth 1.0 strategy for connecting to YouTube
https://github.com/jamiew/omniauth-youtube
19 stars 18 forks source link

Youtube authentication failing #7

Closed akrishhna closed 11 years ago

akrishhna commented 12 years ago

I am having multiple auths(facebook, twitter..) in my application. I am using omniauth- youtube gem for youtube authentication. Its working fine in few cases and not in few other.

When I am logged in to the application with gmail account and trying to authenticate to youtube(using the same gmail account) it returns to omniauth callback controller failure action with AUTH parameters NULL.

But when I tried to authenticate to youtube with another email id (which is not is users table) it worked fine.

Can't we authenticate to youtube using the email id which is already in Users table. Please let me know what might be the issue.

jamiew commented 12 years ago

Omniauth doesn't know about models, if a user is logged-in, or anything about how your app is structured – it just sends back the data it gets from the OAuth provider.

Does this happen with other providers? I'm guessing this is a bug in your application logic

On Aug 24, 2012, at 8:53 AM, Ashwini Krishna notifications@github.com wrote:

I am having multiple auths(facebook, twitter..) in my application. I am using omniauth- youtube gem for youtube authentication. Its working fine in few cases and not in few other.

When I am logged in to the application with gmail account and trying to authenticate to youtube(using the same gmail account) it returns to omniauth callback controller failure action with AUTH parameters NULL.

But when I tried to authenticate to youtube with another email id (which is not is users table) it worked fine.

Can't we authenticate to youtube using the email id which is already in Users table. Please let me know what might be the issue.

— Reply to this email directly or view it on GitHub.

akrishhna commented 12 years ago

Thanks for the swift response.

No, this does not happen with other providers. I am not sure if there is a bug in my app logic. My call back url is -- match '/users/auth/youtube/callback', :to => 'users/omniauth_callbacks#youtube' . When I try to authenticate to Youtube its not even returning the AUTH params.

Below is my log:

Started GET "/users/auth/youtube/callback?code=4/O4GjfPBGSZ_KEhyMdyoqZ42AH0Aa.AiVqRaZHJLoQuJJVnL49Cc-8R_O0cgI" for 127.0.0.1 at 2012-08-24 16:09:24 -0500 Processing by Users::OmniauthCallbacksController#failure as HTML Parameters: {"code"=>"4/O4GjfPBGSZ_KEhyMdyoqZ42AH0Aa.AiVqRaZHJLoQuJJVnL49Cc-8R_O0cgI"} Origin: --- http://olemiss.lvh.me:3000/ ... AUTH RETURN: --- !!null ... params: --- code: 4/O4GjfPBGSZ_KEhyMdyoqZ42AH0Aa.AiVqRaZHJLoQuJJVnL49Cc-8R_O0cgI Redirected to http://www.lvh.me:3000/d/users/sign_in Completed 302 Found in 112ms

I need to debug and see what might be the issue.

akrishhna commented 12 years ago

I am using gem 'omniauth-google-oauth2' instead and every thing is working fine. I am thinking this could be something to do with the Youtube strategy class. If I find out anything I will keep you posted.

nuriel commented 10 years ago

+1, i want to confirm this issue.

works perfectly with all other providers (fb, vimeo) and works after changing to google-oauth2

just a tip that might save time for others that want to change strategy while keeping it clear it's all about youtube- add the oauth2 gem and in the config add the name param, to seamlessly change the gems: config.omniauth :google_oauth2,KEY,SECRET, { access_type: "offline", approval_prompt: "force", name: "youtube" }

jamiew commented 10 years ago

Could we consider this gem deprecated in favor of the above google_oauth2 configuration?

On Mon, Dec 23, 2013 at 8:08 PM, Nuriel notifications@github.com wrote:

+1, i want to confirm this issue.

works perfectly with all other providers (fb, vimeo) and works after changing to google-oauth2

just a tip that might save time for user- add the oauth2 gem and in the config add the name param, to seamlessly change the gems: config.omniauth :google_oauth2,KEY,SECRET, { access_type: "offline", approval_prompt: "force", name: "youtube" }

— Reply to this email directly or view it on GitHubhttps://github.com/jamiew/omniauth-youtube/issues/7#issuecomment-31153268 .

nuriel commented 10 years ago

:+1:

jamiew commented 10 years ago

What's typical policy in this case? Yank the gem?