Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

support OAuth authentication #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

koshilife
Copy link

@koshilife koshilife commented Sep 13, 2020

We support OAuth authentication by new OAuthAPI class.

Since OAuth authentication is provided by kintone platform, it's worth to provide a method from the library.

OAuthAPI class usage is following and we updated README also.

# Use OAuth authentication
api = Kintone::OAuthApi.new("example.cybozu.com", "access_token")
# if set oauth options below, you can refresh the access_token.
oauth_options = {
  client_id: 'client_id',
  client_secret: 'client_secret',
  refresh_token: 'refresh_token',
  expires_at: 1599921045
}
api = Kintone::OAuthApi.new("example.cybozu.com", "access_token", oauth_options)
# get new token.
api.refresh!
api.access_token.token
# => "new_access_token"

@koshilife
Copy link
Author

koshilife commented Sep 14, 2020

We made a gem kintone-oauth-extension in temporary for someone want to use oauth authentication.

You can try this feature.

gem install kintone-oauth-extension

or execute bundle install command after you insert the following into Gemfile

gem 'kintone-oauth-extension'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant