Sha256: 28184db70b6c3329b100bc7665539c191f30533ab97cb0f70a16d312bdf53a64

Contents?: true

Size: 785 Bytes

Versions: 14

Compression:

Stored size: 785 Bytes

Contents

require 'signet'

module Signet #:nodoc:
  module OAuth1
    module PLAINTEXT
      def self.generate_signature(
          base_string, client_credential_secret, token_credential_secret)
        # Both the client secret and token secret must be escaped
        client_credential_secret =
            Signet::OAuth1.encode(client_credential_secret)
        token_credential_secret =
            Signet::OAuth1.encode(token_credential_secret)
        # The key for the signature is just the client secret and token
        # secret joined by the '&' character.  If the token secret is omitted,
        # the '&' must still be present.
        key = [client_credential_secret, token_credential_secret].join("&")
        return Signet::OAuth1.encode(key).strip
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
signet-0.11.0 lib/signet/oauth_1/signature_methods/plaintext.rb
signet-0.10.0 lib/signet/oauth_1/signature_methods/plaintext.rb
signet-0.9.2 lib/signet/oauth_1/signature_methods/plaintext.rb
signet-0.9.1 lib/signet/oauth_1/signature_methods/plaintext.rb
signet-0.9.0 lib/signet/oauth_1/signature_methods/plaintext.rb
signet-0.8.1 lib/signet/oauth_1/signature_methods/plaintext.rb
signet-0.8.0 lib/signet/oauth_1/signature_methods/plaintext.rb
signet-0.7.3 lib/signet/oauth_1/signature_methods/plaintext.rb
signet-0.7.2 lib/signet/oauth_1/signature_methods/plaintext.rb
signet-0.7.1 lib/signet/oauth_1/signature_methods/plaintext.rb
signet-0.7.0 lib/signet/oauth_1/signature_methods/plaintext.rb
signet-0.6.1 lib/signet/oauth_1/signature_methods/plaintext.rb
signet-0.6.0 lib/signet/oauth_1/signature_methods/plaintext.rb
signet-0.5.1 lib/signet/oauth_1/signature_methods/plaintext.rb