Closed gaurijo closed 11 months ago
I think omniauth-google is not the right tool for this job. OmniAuth is used for logging into the Book Tracker itself, so if we were using omniauth-google, we would be able to log into the Book Tracker itself using our Google account credentials. But it wouldn't get us any closer to downloading that file.
If there is a solution, it could probably be fully encapsulated within the Google.check()
method. Instead of reading the inventory file (_all_books.txt
) from the application S3 bucket, here, it could be modified to go out and download it. That is the hard part, as the file is protected behind Google's authentication system which, as you noted, is automation-resistant. If it were available via Google's OAuth API, then an OAuth client library like this one could be used to access it. But it doesn't seem like that is the case.
It may just be that this problem is not solvable.
Okay, yes, it does seem like we've hit a wall in terms of automating the google check, so I'm wondering if it's best to table this issue (at least for now).
I could start working on issue 6, and at least see if I can get the Hathitrust
and IA
checks to run in parallel after the import is done.
I guess the Google Check will just have to be a standalone manual check until a solution can be found, if any.
(This is a WIP and NOT ready to be merged yet)
This PR includes the following:
Installs
google omniauth2 gem
configures
omniauth.rb
to include thegoogle_oauth2
as a provider and calls on googleclient_id
andsecret
variables (these keys are stored inside thedevelopment.yml
)replaces
/auth/:provider/callback
with two specific routes:/auth/developer/callback
and/auth/google_oauth2/callback
The updated routes now point to a
developer
andcreate
actions inside theSessions Controller
(I will separate the two out later when things are more stable)Adds a button inside the
_check_google view
to initiate the oauth process (it's just hanging in the corner of the window right now, i will clean it up later)Here is where I'm stuck at the moment: When I click on the
sign in with Google button
, I'm redirected to the following:I definitely have the
client_id
andclient_secret
set up from the original Developer Console account, so I'm not sure why this error is occuring:Google Developer Console has some changes, including
authorized JavaScript origins
, andauthorized redirect URIs
: