google-drive-ruby
google-drive-ruby copied to clipboard
Deprecated OAuth out-of-band (oob) flow
OAuth out-of-band (oob) flow will be deprecated
https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html
https://github.com/gimite/google-drive-ruby/blob/55b996b2c287cb0932824bf2474248a498469328/lib/google_drive/session.rb#L158
New OAuth usage will be blocked for the OOB flow
Can we migrate to an alternative flow? https://developers.google.com/identity/protocols/oauth2/native-app#redirect-uri_loopback
Hi, i think the error redirect url not valid, i have same issue with you and i solved the issue.
maybe the step link this
- you create new routes for get callback response from google, maybe like this get 'google_drive_response', to: 'public_page#google_drive_response'
- you register url on google console
- change redirect url change to routes callback response, for example like this redirect_uri: "http://localhost:3000/google_drive_response/"
i hope you issue is solved, because me solved the issue:))
Also waiting for a proper solution on this. @gimite ?
Wouldn't it be a solution to replace:
https://github.com/gimite/google-drive-ruby/blob/55b996b2c287cb0932824bf2474248a498469328/lib/google_drive/session.rb#L158C1-L159C1
with
redirect_uri: config.redirect_uri
and just pass a 'dummy' redirect_uri in your method? Something like this:
require 'google_drive'
require 'google_drive'
class GoogleDriveService
attr_accessor :client_id, :client_secret, :redirect_uri, :refesh_token, :scope, :save, :scope, :refresh_token
def initialize(client_id, client_secret, redirect_uri)
@client_id = client_id
@client_secret = client_secret
@redirect_uri = redirect_uri
end
def create_session
session = GoogleDrive::Session.from_config(self)
end
end```