Code Monkey home page Code Monkey logo

Comments (5)

anthonyjgrove avatar anthonyjgrove commented on June 6, 2024

So the access_token you get from the react component is the one time token you can use on your server to get another token to be used later with api calls to other Google services like YouTube.

Also: 123SERVER123.apps.googleusercontent.com does not go into scope, it is your client id and should be the same on both the react component and on your server.

What library are you using for server side Google oAuth?

This might be what you need: https://developers.google.com/api-client-library/ruby/

from react-google-login.

makeitTim avatar makeitTim commented on June 6, 2024

Thanks Anthony! I appreciate the response!

On the backend I am using a youtube ruby gem https://github.com/Fullscreen/yt

I've used the access_token from the react component in the backend server to setup an account with this yt gem. That's what causes the 403 error.

Perhaps I cannot use the access_token directly on the server? But I must use that to get a new token for the server? I don't know how to do that with yt, but I can look into the api-client-library.

I can use the same client_id on front-end and backend, I was originally doing that.

from react-google-login.

anthonyjgrove avatar anthonyjgrove commented on June 6, 2024

Yes you will have to use the same client_id on the front and backend or it won't work.

I looks like you should be able to use the non-offline access_token from the component and use it in this, is that what you are currently trying?

# Content owners can be initialized with access token, refresh token or an authorization code content_owner = Yt::ContentOwner.new owner_name: 'CMSname', access_token: 'ya29.1.ABCDEFGHIJ'

from react-google-login.

makeitTim avatar makeitTim commented on June 6, 2024

No, I was using account = Yt::Account.new access_token: token. You were totally right, I should be using the ContentOwner class. Now works! Fantastic!

Basically, your module was working awesome I just was struggling to use the unrelated backend ruby stuff correctly. Thanks for saving my day!

from react-google-login.

anthonyjgrove avatar anthonyjgrove commented on June 6, 2024

Glad to hear.

from react-google-login.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.