Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8906593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:41:48+00:00 2026-06-15T02:41:48+00:00

I have omniauth set up correctly and I am able to parse several other

  • 0

I have omniauth set up correctly and I am able to parse several other provider responses, including some of the attributes for a YouTube user but I am not able to get the YouTube user’s link to their channel. Here is what the response looks like, I am trying to get the link on the last line:

--- !ruby/hash:OmniAuth::AuthHash
provider: youtube
uid: http://gdata.youtube.com/feeds/api/users/DLjkduRouoiweRktkkl
info: !ruby/hash:OmniAuth::AuthHash::InfoHash
  uid: http://gdata.youtube.com/feeds/api/users/DLjkduRouoiweRktkkl
  nickname: Example User
  email: exampleuser@gmail.com
  first_name: Example
  last_name: User
  image: http://lh3.googleusercontent.com/-7vCkdsSDAfsU/AAAAAAAAAAA/kjRe3kjk/s88-c-k/photo.jpg
  description: 
  location: Example City CA, US
  channel_title: Example User
  subscribers_count: '66'
credentials: !ruby/hash:Hashie::Mash
  token: kh58.lkjASDF93-W2-ADFJkjfdo498_W8IWnjWTWY
  expires_at: 1354004818
  expires: true
extra: !ruby/hash:Hashie::Mash
  user_hash: !ruby/hash:Hashie::Mash
    xmlns: http://www.w3.org/2005/Atom
    xmlns$media: http://search.yahoo.com/mrss/
    xmlns$gd: http://schemas.google.com/g/2005
    xmlns$yt: http://gdata.youtube.com/schemas/2007
    id: !ruby/hash:Hashie::Mash
      $t: http://gdata.youtube.com/feeds/api/users/DLjkduRouoiweRktkkl
    published: !ruby/hash:Hashie::Mash
      $t: '2012-02-14T23:39:43.000Z'
    updated: !ruby/hash:Hashie::Mash
      $t: '2012-11-27T06:07:22.000Z'
    category:
    - !ruby/hash:Hashie::Mash
      scheme: http://schemas.google.com/g/2005#kind
      term: http://gdata.youtube.com/schemas/2007#userProfile
    title: !ruby/hash:Hashie::Mash
      $t: Example User
      type: text
    content: !ruby/hash:Hashie::Mash
      $t: Example user channel description
      type: text
    link:
    - !ruby/hash:Hashie::Mash
      rel: alternate
      type: text/html
      href: http://www.youtube.com/channel/kljasdSDAF98324
      .
      .
      .

I can get to things like “nickname” at the top by doing this in my user model:

def add_omniauth(auth)
  user.name = auth["info"]["nickname"]
end

But how on earth do I get to that URL at the very bottom? I tried:

user.link = auth["extra"]["user_hash"]["link"]["href"]

but to no avail. As a rails and ruby newbie, I appreciate the help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:41:50+00:00Added an answer on June 15, 2026 at 2:41 am

    Okay, so as it turns out, link: in the youtube response is an array. You can tell because it isn’t listed as a hash next to it. I learned that after speaking with a friend of mine over here. So in order to get that link at the bottom of the response:

    self.url = auth["extra"]["user_hash"]["link"].first["href"]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using omniauth-twitter and I have everything set up: user.rb: def self.create_with_omniauth(auth) create! do
We have a web app running on Rails, using Devise and OmniAuth for user
In my omniauth initializer file I have these settings: provider :facebook, 'a_key', 'another_key', :scope
I have the following in my Omniauth callback: @user = User.find_for_linked_in_oauth(env[omniauth.auth], current_user) I expect
I have the following action: users.rb: def omniauth_create auth = request.env[omniauth.auth] user = User.from_omniauth(env[omniauth.auth])
I have the following code: user.rb : def self.create_with_omniauth(auth) create! do |user| user.provider =
I have devise/omniauth set up and now I would like to use the Facebook
I have OmniAuth setup to use Twitter like so: Rails.application.config.middleware.use OmniAuth::Builder do provider :twitter,
I have a small app using omniauth and I'm testing it with LinkedIn provider
We have used Devise + OmniAuth as authentication mechanism to authenticate user with facebook,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.