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

Youtube authentication failing #7

Closed
akrishhna opened this issue Aug 24, 2012 · 7 comments
Closed

Youtube authentication failing #7

akrishhna opened this issue Aug 24, 2012 · 7 comments

Comments

@akrishhna
Copy link

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
Copy link
Owner

jamiew commented Aug 24, 2012

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
Copy link
Author

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
Copy link
Author

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.

@jamiew jamiew closed this as completed Nov 28, 2012
@nuriel
Copy link

nuriel commented Dec 24, 2013

+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
Copy link
Owner

jamiew commented Dec 24, 2013

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//issues/7#issuecomment-31153268
.

@nuriel
Copy link

nuriel commented Dec 24, 2013

👍

jamiew added a commit that referenced this issue Dec 24, 2013
@jamiew
Copy link
Owner

jamiew commented Dec 24, 2013

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

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

No branches or pull requests

3 participants