I am very new to rails and trying to build an app which can interact with Google DRIVE Api V3. I have scaffolded a Rails 5 App and used Devise Gem along with Google OmniAuth2 to authenticate and register the user and grant access to his Drive. But according to https://github.com/google/google-auth-library-ruby we need to get authorization token before making the API call.
I am not able to find any example as even the Google Drive example the Ruby example is deprecated
Any help would be greatly appreciated
Great idea. The google API is definitely not the simplest API to work with in Rails because it's so generic. I will definitely try to cover it soon.
For some help in the meantime, the main things you're going to need is to make sure that your scope is set properly for Drive authorization. That will make sure once you have keys you can access Drive with them. I would probably recommend using this library over the google one because this does the same thing but is setup nicely to work within Omniauth which Devise supports. Configuration is super easy and will save you a lot of time: https://github.com/zquestz/omniauth-google-oauth2
Thank you for the reply really appreciate your pointers. After leaving the comment on the website I have tried and am able to integrate Rails with Devise and Google Omniauth2 . So currently my app users can sign up with their google credentials and while signing up for the first time Google sends back the access_token and refresh token . I have persisted the refresh token into the DB. The part where it gets tricky for me is using rails how do i now send a post request to Google using Google API.
The example Google mentions is not using rails and is really not helpful. Hopefully you can cover this soon.
Looking forward to it. Thank you once again
Join 30,005+ developers who get early access to new screencasts, articles, guides, updates, and more.