Sha256: f2b8d34e739654a6f29c9c36f7a8ea2a31f3b1367ccfbc63561f2fd1ad3ba996

Contents?: true

Size: 577 Bytes

Versions: 10

Compression:

Stored size: 577 Bytes

Contents

require "base64"

module ChatWork
  class OAuthClient < BaseClient
    require "chatwork/oauth_client/token_methods"

    include TokenMethods

    # @param client_id     [String]
    # @param client_secret [String]
    # @param api_base      [String] default is {ChatWork.oauth_api_base}
    def initialize(client_id:, client_secret:, api_base: nil)
      api_base ||= ChatWork.oauth_api_base
      signature = Base64.encode64("#{client_id}:#{client_secret}").delete("\n")
      super(api_base: api_base, header: { "Authorization" => "Basic #{signature}" })
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
chatwork-1.0.1 lib/chatwork/oauth_client.rb
chatwork-1.0.0 lib/chatwork/oauth_client.rb
chatwork-0.12.3 lib/chatwork/oauth_client.rb
chatwork-0.12.2 lib/chatwork/oauth_client.rb
chatwork-0.12.1 lib/chatwork/oauth_client.rb
chatwork-0.12.0 lib/chatwork/oauth_client.rb
chatwork-0.11.0 lib/chatwork/oauth_client.rb
chatwork-0.10.0 lib/chatwork/oauth_client.rb
chatwork-0.9.0 lib/chatwork/oauth_client.rb
chatwork-0.8.0 lib/chatwork/oauth_client.rb