Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add example in Readme for the Oauth2.0 flow #245

Closed
wants to merge 1 commit into from

Conversation

duykhoa
Copy link

@duykhoa duykhoa commented Oct 21, 2019

This pull request adds an example for the usage of this library in the Oauth 2.0 flow, it is related to the issue #81 .

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 21, 2019
@mtomov
Copy link

mtomov commented Oct 30, 2019

#81 (comment)

This solution definitely works. What's different are a few additional attributes:

secrets = Google::APIClient::ClientSecrets.new(
      {
        "web" =>
          {
            "access_token" => current_user.token,
            "refresh_token" => current_user.refresh_token,
            "client_id" => Rails.application.secrets[:google_client_id],
            "client_secret" => Rails.application.secrets[:google_secret]
          }
      }

maybe it's good to clarify if/when those are needed as well.

require "google/apis/oauth2_v2"

Google::Apis::Oauth2V2::Oauth2Service.new.tap do |client|
authorization = Google::APIClient::ClientSecrets.new(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to install the client secret package with their new generated package system?
"google-api-client" is deprecated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been moved to google-apis-core.

@bajajneha27
Copy link
Contributor

Hi, thank you for raising this PR and apologies for long delay delay in responding. At the moment, we won't be able to address this but we're definitely going to work on it. I've created another issue to keep track of it, you can follow it #367
I'm closing this PR for now. Please feel free to re-open it in case you have any other concern.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants